Skip to content

Quickstart

Open in ChatGPT Open in Claude

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>:

    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.

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

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

    Full guide: User context.

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

    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.

  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.