Guides / Signups & Auth

Get Notified When a User Signs Up via Auth0

4 min read·Signups & Auth

How It Works

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.

Step 1: Create an Auth0 Action

  1. In the Auth0 Dashboard, go to Actions → Library → Build Custom
  2. Name it "Notify LogIt on Signup"
  3. Select trigger: Post User Registration
  4. Paste the code below and click Deploy

The Action Code

js
// 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,
      },
    }),
  });
};

Step 2: Add the Secret

In the Action editor, go to Secrets and add:

  • Key: LOGIT_API_KEY
  • Value: your LogIt project API key

Step 3: Add the Action to the Flow

  1. Go to Actions → Flows → Post User Registration
  2. Drag your "Notify LogIt on Signup" Action into the flow
  3. Click Apply

Connection Strategy Values

StrategyWhat it means
auth0Email/password signup
google-oauth2Google OAuth
githubGitHub OAuth
appleSign in with Apple

Tips

  • Log connection.strategy in tags so you can filter by auth method in the LogIt dashboard.
  • The post-user-registration trigger only fires for new accounts — not social logins on existing accounts.
  • Wrap the 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.

Start free