Guides / Signups & Auth
Auth0 Actions let you run custom code at specific points in the auth pipeline. The post-user-registration trigger fires exactly once — after a user account is created — making it the perfect place to fire a LogIt event.
// Auth0 Action — Post User Registration
exports.onExecutePostUserRegistration = async (event) => {
const { user, connection } = event;
await fetch("https://api.logit.now/api/ingest", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + event.secrets.LOGIT_API_KEY,
},
body: JSON.stringify({
channel: "signups",
event: "New user signed up",
description: user.email ?? user.phone_number ?? "anonymous",
icon: "👤",
notify: true,
tags: {
connection: connection.name,
strategy: connection.strategy,
},
metadata: {
userId: user.user_id,
email: user.email ?? null,
name: user.name ?? null,
provider: connection.strategy,
},
}),
});
};
In the Action editor, go to Secrets and add:
LOGIT_API_KEY| Strategy | What it means |
|---|---|
auth0 | Email/password signup |
google-oauth2 | Google OAuth |
github | GitHub OAuth |
apple | Sign in with Apple |
connection.strategy in tags so you can filter by auth method in the LogIt dashboard.post-user-registration trigger only fires for new accounts — not social logins on existing accounts.fetch call in a try/catch so a LogIt failure never blocks the registration flow.Try LogIt free
7-day trial. No credit card required.