# Quickstart

Go from zero to a working agent — embed the SDK, identify the user, connect one action, and see it run.

Get a working agent in four steps. Each links to its full guide for depth.

1. **Embed the SDK.** Copy your snippet from **Agent Studio → Setup** (pre-filled with your Agent Key) and paste it before `</body>`:

   ```html title="index.html"
   <script type="text/javascript">
     (function (w, d, u, n, k, c) {
       w[n] = w[n] || function () { (w[n].q = w[n].q || []).push(arguments); };
       w.__FOLD_SPACE__ = n; w[n].k = k; w[n].c = c;
       var s = d.createElement('script'); s.async = true; s.src = u + '?k=' + k;
       var h = d.getElementsByTagName('script')[0]; h.parentNode.insertBefore(s, h);
     })(window, document, 'https://script.eucerahive.io/web/sdk/foldspace.js', 'foldspace', 'YOUR-AGENT-KEY');
   </script>
   ```

   Full guide: [Setup](/start/install/).

2. **Identify the user and show the agent** inside the `when('ready')` callback:

   ```javascript
   foldspace('when', 'ready', () => {
     foldspace.identify({ user: { id: 'YOUR-USER-ID' } });
     // render the agent (embedded or floating widget) — see Setup
   });
   ```

   Full guide: [User context](/start/user-context/).

3. **Connect an action.** Register a handler under an Action Key you defined in Agent Studio:

   ```javascript
   foldspace('when', 'ready', () => {
     foldspace.agent({ /* setup */ }).addActionHandlers({
       create_task: {
         execute: async (params) => {
           // params matches the action's input schema; do the work,
           // then return data for the agent to use in its reply
         },
       },
     });
   });
   ```

   Full guide: [Connect actions](/guides/connecting-actions/).

4. **Verify.** Open the agent and ask it to do what your action handles. Confirm the handler runs and the agent replies with your returned data. To watch every call, subscribe with [Agent Event](/reference/agent-event-api/).

## Next steps

- [Build actions](/guides/build-actions/): add more capabilities.
- [Agentic UI](/guides/recipes/): render interactive components in the chat.
- [Security](/security/overview/): verify user identity and lock down domains.
