New device notifications are a key security measure to help identify potentially unauthorized access to user accounts. When there is a login from a new device, IP address, or location, they should receive a notification. If the login is unauthorized, the user can take immediate action like revoking sessions, resetting their password, or contacting your support team. You can easily send notifications for new devices, IP address, and login locations with Stytch Device Fingerprinting. At a high level, you will include a Telemetry ID (for device information) in your authentication requests. Stytch will return new device flags in the authentication response and as a webhook event.Documentation Index
Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
Use this file to discover all available pages before exploring further.

- Collect device fingerprints from the frontend and submit them as part of the authentication request
- Use the Stytch response or webhook to detect new devices
- Implement your own method to notify your user about unusual logins
This guide uses an integrated approach where you use Stytch authentication and Device Fingerprinting together.This guide uses Consumer authentication. If you are using B2B authentication, the methods are similar.
Prerequisites
- A Stytch project for Consumer Authentication.
- If you don’t have one already, in the Dashboard, click on your existing project name in the top left corner of the Dashboard. Click Create Project, and then select B2B Authentication or Consumer Authentication.
- Access to Device Fingerprinting. If you don’t have access, you can request a trial.
- An application that has already implemented an authentication method with Stytch.
Collecting device fingerprints and submitting them
You will use Stytch Device Fingerprinting to collect device information. The implementation differs depending on whether you use a frontend SDK or a backend SDK.- Frontend SDK or mobile SDK
- Backend SDK
If you’re using one of Stytch’s frontend or mobile SDKs, you can automatically collect and submit fingerprints by turning on Protected Auth.On the dashboard Frontend SDK page, under optional configuration, enable Protected Auth.
In Observation mode, this will collect and record device information. In Enforcement mode, Protected Auth will also block authentication attempts that receive a BLOCK verdict.For sending new device notifications, you can use either mode.

Detecting new devices through webhook or response
You can detect new devices in two ways:- Using a webhook sent by Stytch
- Or, in the response body for a backend authenticate request
Webhook
You can use webhooks to receive data about new devices. If you’re using one of Stytch’s frontend or mobile SDKs, this is the only way to send new device notifications. If you’re using a backend integration, you can use either webhooks or the authenticate response. With webhooks, you can de-couple the core application logic and any notifications you send. In the Webhooks page of the Dashboard, you will configure a new webhook URL. Your application should listen on this URL for new device events.
- Consumer auth
- Multi-tenant auth
In Consumer auth, you can subscribe to the
direct.user_device.new_device_attribute event to receive notifications about new devices. The resulting events will look like this:.is_new will be true if this is the first time any of the following attributes have been seen for this user:
- Device (based on Visitor ID)
- IP address
- Country (based on IP geolocation)
first_seen_at and last_seen_at fields for additional context.
If a user logs in with a combination of device, IP address, and country that are all already-known, no webhook event will be sent.
You can write custom code that listens for the new_device_attribute. When a new device is detected, notify the user through email, push notification, or in-app inbox.
Authenticate response (backend only)
If you are using a backend integration, you can use the response body to detect new devices and send notifications.- Consumer auth
- Multi-tenant auth
Every endpoint supported by user device history will return a
user_device field. For example, if you are using Email Magic Links, the response will look something like this:Best practices for notifications
Once you’ve detected a login from a new device, you can notify them. Here are a few things to keep in mind when sending new device notifications:- “Not me” action
- Balancing signal and noise
- Latency considerations
”Not me” action
Your new device notification should include a “Not me” action to take if the login was not actually coming from the real user. When the user selects “Not me”, you can respond immediately to the suspicious login:- Help them contact your support team with relevant information
- Automatically revoke all sessions associated with that user
- For password-based logins, you can reset the password
- Increase your password requirements, including turning on breach detection
- Switch away from password-based logins to use more secure options like passwordless (magic links) or OAuth
- Add MFA through SMS, TOTP, or Passkeys
Balancing signal and noise
A new device is not necessarily an indicator of a bad actor attempting to log in. The three new device attributes will naturally change over time for real users:- The
visitor_idmay change due to users switching browsers or clearing their cache. - IP addresses change naturally. Users may switch networks during normal usage, especially on mobile devices or when using VPNs. Even on the same network, Internet Service Providers (ISPs) may change the IP address of a client.
- The
ip_geo_countryis based on IP address and may change more frequently in geographical areas where multiple countries are close to each other.
Latency considerations
If you are using the authenticate response in your backend integration, consider the latency impact. For example, when a user logs in from a new device, you may want to send a notification via email. Sending an email can take multiple seconds, so it would be a poor experience if the user needed to wait for the email to be sent before they completed their login. Instead of synchronously sending notifications in your application code, you can send notifications async or add them to a task queue, while immediately returning the logged-in session to the user.What’s next?
Want to try Stytch Device Fingerprinting?
Find out why Stytch’s device intelligence is trusted by Calendly, Replit, and many more.