Add data
client.data.add(stringnamespace, DataAddParams { data } body, RequestOptionsoptions?): DataAddResponse { requestId, status }
/v1/data/{namespace}
Add data to a namespace. This method returns immediately; data is processed asynchronously.
Parameters
namespace: string
The namespace to ingest data into
Returns
Add data
import Safetykit from 'safetykit';
const client = new Safetykit({
apiKey: process.env['SAFETYKIT_API_KEY'], // This is the default and can be omitted
});
const response = await client.data.add('namespace', {
data: {
id: 'user-12345',
display_name: 'Jane Smith',
headline: 'Product Designer at TechCorp',
bio: 'Passionate about creating intuitive user experiences. 10+ years in UX/UI design.',
location: 'San Francisco, CA',
profile_image: 'https://cdn.example.com/users/12345/avatar.jpg',
cover_photo: 'https://cdn.example.com/users/12345/cover.jpg',
website: 'https://janesmith.design',
follower_count: 15420,
is_verified: true,
tags: ['designer', 'ux', 'product'],
},
});
console.log(response.requestId);
{
"requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
"status": "accepted"
}
Returns Examples
{
"requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
"status": "accepted"
}