Skip to content

User context

Open in ChatGPT Open in Claude

User context lets you attach optional attributes to the people using your agent, so sessions and analytics carry richer detail. Identity is built in: every field below is optional and exists to give you deeper observability.

Create custom user and subscription attributes under Settings > Attribute Settings.

Pass a context object to foldspace.identify() once the SDK is ready.

const context = {
user: {
id: '7d8da9a5-53f3-4bc0-8921-1cceecb8107',
},
subscription: {
id: 'subscription-12345'
// add custom attributes here after creating them in Attribute Settings
}
}
foldspace('when', 'ready', () => {
foldspace.identify(context);
});

Add any of the optional attributes below to enrich the user record.

const context = {
user: {
id: '7d8da9a5-53f3-4bc0-8921-1cceecb8107',
email: 'user12345@example.com',
name: 'John Doe',
role: 'admin',
image: 'https://example.com/images/user12345.jpg',
phone: '+1234567890',
timezone: 'America/New_York',
signUpDate: 1707164462000,
location: {
country: "USA",
region: "Northeast",
state: "New York",
city: "New York City",
postalCode: "10001"
}
// add custom attributes here after creating them in Attribute Settings
},
subscription: {
id: 'subscription-12345'
// add custom attributes here after creating them in Attribute Settings
}
}
foldspace('when', 'ready', () => {
foldspace.identify(context);
});