Skip to main content

getUser

Retrieve the profile and settings for the currently authenticated user.

Parameters

This query does not accept parameters. It automatically returns data for the authenticated user based on the authorization token.

Response

user
User
The authenticated user’s profile

Examples

query GetCurrentUser {
  user {
    id
    email
  }
}

Authentication

This query requires authentication. Include your JWT token in the request headers:
Headers
Authorization: Bearer YOUR_JWT_TOKEN

Use Cases

Profile Display

Display user information in your application:
React Example
const { data } = useQuery(GET_USER);

return (
  <div>
    <h1>Welcome, {data?.user?.email}</h1>
    <p>User ID: {data?.user?.id}</p>
  </div>
);

Notification Settings

Show user’s active notification channels:
Notification Settings
const activeChannels = user.notificationChannels.nodes.filter(
  channel => channel.isEnabled
);

return (
  <ul>
    {activeChannels.map(channel => (
      <li key={channel.id}>
        {channel.channelType} - Enabled
      </li>
    ))}
  </ul>
);

Verify Notification Setup

Check if the user has configured notification channels before creating price rules:
Validation
const hasNotifications = user.notificationChannels.nodes.some(
  channel => channel.isEnabled && channel.channelType !== 'none'
);

if (!hasNotifications) {
  // Prompt user to set up notifications
  showNotificationSetupDialog();
}

Integration with Price Rules

User notification preferences work seamlessly with price rules:
query GetUserWithRules {
  user {
    id
    email
    notificationChannels {
      nodes {
        channelType
        isEnabled
      }
    }
  }
  
  priceRules {
    nodes {
      id
      name
      notificationChannel
      instrument {
        symbol
      }
    }
  }
}

Notification Channel Types

none
NotificationChannelType
No notifications will be sent
sms
NotificationChannelType
SMS text messages to configured phone number
email
NotificationChannelType
Email notifications to user’s email address
webhook
NotificationChannelType
HTTP POST requests to configured webhook URL
telegram
NotificationChannelType
Messages via Telegram bot
push_notification
NotificationChannelType
Push notifications to mobile devices

Privacy & Security

  • User data is scoped to the authenticated user only
  • Other users’ information is never exposed
  • Email addresses are private and not shared
  • Notification channel configurations may contain sensitive data (phone numbers, webhook URLs)

Build docs developers (and LLMs) love