Install the Foldspace SDK with one snippet. Copy yours from Agent Studio → Setup (pre-filled with your loader URL and Agent Key) and paste it before the closing </body> tag. The SDK loads asynchronously, so it never blocks or slows your site.
foldspace.identify() ties the session to your signed-in user. This is what gives the agent real user context and persists each user’s conversation history across sessions and devices, instead of treating every visit as a new anonymous session.
Identity is built in, so the agent runs without identify(), but pass your real user.id (and subscription.id, if you bill by subscription) in production. Add fields like email, name, role, or your own attributes to enrich context and analytics. See User context for the full field list and custom attributes.
Once you have your Agent Key, you can skip the manual wiring and let your AI coding tool do the integration:
Set up with your AI coding tool
Install the Foldspace plugin and your AI coding tool will integrate Foldspace for
you: add the agent, connect your authenticated users, and discover your product's
actions.