SDK Javascript Integration
Use an SDK for the fastest production integration.
Node.js / TypeScript
npm install @veilio/sdkimport { VeilioClient } from "@veilio/sdk";
const veilio = new VeilioClient({
apiKey: process.env.VEILIO_API_KEY!,
baseUrl: process.env.VEILIO_BASE_URL || "https://app.veilio.xyz/api",
});
export async function createCustomer(email: string) {
const { token } = await veilio.tokenize({
data: email,
type: "email",
});
// Store token in your DB, not the raw email.
return { emailToken: token };
}
export async function sendWelcomeEmail(emailToken: string) {
const { data: email } = await veilio.detokenize({
token: emailToken,
reason: "Send welcome email",
});
return email;
}
// Call when a user requests account deletion (GDPR right to erasure)
export async function deleteUserData(emailToken: string) {
await veilio.shredToken({
token: emailToken,
reason: "GDPR - user deletion request",
});
}Client configuration
Variable
Description
API reference
Bulk operations
Retention and shredding
Error handling
Code
HTTP
Description
TypeScript
Requirements
Last updated
Was this helpful?
