SDK 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;
}Bulk operations
Last updated
Was this helpful?
