Documentation Index
Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
Use this file to discover all available pages before exploring further.
Crossmint Auth is designed for staging and moving fast. For production applications,
Crossmint strongly recommends connecting your own authentication provider for full control
over user management. See the Bring Your Own Auth guide.
Webhook Events
users.created
This webhook is triggered when a new user is created.
Payload
{
"type": "users.created",
"status": "success",
"data": {
"id": "123", // User's identifier
"email": "test@test.com", // Optional (if user was created with email)
"phoneNumber": "123456789" // Optional (if user was created with phone number)
}
}
users.updated
This webhook is triggered when a user’s email or phone number is successfully updated.
Payload
{
"type": "users.updated",
"status": "success",
"data": {
"actionId": "1234", // Update action identifier
"userId": "123", // User identifier
"oldEmail": "test@test.com", // Optional (if user was created with email)
"newEmail": "test2@test2.com", // Optional (if user was created with email)
"oldPhoneNumber": "123456789", // Optional (if user was created with phone number)
"newPhoneNumber": "987654321" // Optional (if user was created with phone number)
}
}
Handling Webhooks
To handle webhooks, you need to set up an endpoint in your application that can receive HTTP POST requests from Crossmint. Here is an example of how you might handle a webhook in a Node.js application:
import express from "express";
const app = express();
app.use(express.json());
function handleUserCreated(data) {
console.log("User created:", data.id);
}
function handleUserUpdated(data) {
console.log("User updated:", data.userId);
}
app.post("/webhooks", (req, res) => {
const event = req.body;
switch (event.type) {
case "users.created":
handleUserCreated(event.data);
break;
case "users.updated":
handleUserUpdated(event.data);
break;
default:
console.log(`Unhandled event type: ${event.type}`);
}
res.sendStatus(200);
});
app.listen(3000, () => {
console.log("Webhook server listening on port 3000");
});