Device ID SDK

Get a unique device identifier for tracking without personal data.

Written By despia

Last updated About 1 year ago

Important: User Validation

The device ID is a crucial security measure for your backend:

  • Validate users during free trials

  • Prevent subscription sharing

  • Stop multiple account creation

  • Track payment sources

  • Monitor login patterns

  • Detect unusual behavior

SDK Usage

// Get device ID
window.despia = "get-uuid://"

// Wait a moment for no-code tools
setTimeout(() => {
    const deviceId = uuid
    // Send to your backend with auth token
}, 100)

Common Uses

Free Trial Protection

window.despia = "get-uuid://"

setTimeout(() => {
    const deviceId = uuid
    // Check if device already used trial
    validateNewTrial({
        deviceId: deviceId,
        userId: currentUser.id
    })
}, 100)

Subscription Validation

window.despia = "get-uuid://"

setTimeout(() => {
    const deviceId = uuid
    // Verify subscription not shared
    validateSubscription({
        deviceId: deviceId,
        subscriptionId: subId
    })
}, 100)

Login Monitoring

window.despia = "get-uuid://"

setTimeout(() => {
    const deviceId = uuid
    // Track login devices
    validateLogin({
        deviceId: deviceId,
        userId: userId
    })
}, 100)

Backend Implementation Tips

  • Store device ID with user accounts

  • Link device ID to subscriptions

  • Track device ID history

  • Monitor multiple accounts per device

  • Check device ID on sensitive actions

  • Flag suspicious patterns

  • Implement trial limitations

  • Validate payment sources

Important for No-Code Tools

Tools like WeWeb or Toddle need a 100ms delay before reading the UUID value.


Need help? Email us at support@despia.com