> For the complete documentation index, see [llms.txt](https://docs.claimr.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.claimr.io/api/user-token.md).

# User token

## **Understanding user tokens**

User tokens are like digital keys that link your users' accounts on your platform to their claimr profiles. This connection allows for a smoother, more personalized experience within your campaigns.

### **How it works**

Your users already have accounts on your platform – whether it's a mobile app, a website, or a crypto exchange. They've signed up, verified their identity, and are ready to engage with your claimr campaigns.

Instead of asking them to create another account or log in separately for claimr, user tokens let you seamlessly connect their existing account with their claimr activity.&#x20;

### **Behind the scenes**

* Your application sends a special request to claimr server to generate a unique token for each user.
* This token is then included in claimr widget that you embed on your platform.
* When a user opens the widget, claimr uses the token to identify them and personalize their experience.

### **Benefits of user tokens**

* **No extra logins:** Users enjoy a frictionless experience without having to remember separate credentials.
* **Personalized content:** You can tailor the claimr experience to each user's preferences and progress.
* **Seamless cross-device experience:** Users can access their claimr profile and progress from any device, as long as they're logged in to your platform.

## **Generate user token**

To generate a user token, follow these steps:

### **Initiate token request**

* Send a GET request to the `/token` endpoint from your server.

Include the following required parameters in your request:

* **Account:** A unique identifier for the user within your system (e.g., user ID, email address).
* **Platform:** A short name representing your organization or platform.
* **Authorization:** Include your organization's secret API token as a Bearer authorization header in the request. This authenticates your application's access to the token generation endpoint.

### **Response**

Upon successful request, a unique user token will be generated and return in the response. This token is permanent and does not expire. You can store it securely to avoid repeated generation.

### **Integrate user token with your application**

Once you have generated the user token, you need to integrate it with your web or native application. This allows claimr to recognize and associate the authenticated user with their activities.

1. **Pass the token:** Transmit the generated user token from your server to your web or application.
2. **Set the token value**: For SDK integration with claimr, you have 2 options:

* Via the data-user-token attribute in the embed script.
* Using the SDK method with window\.claimr.set\_user\_token.

For troubleshooting or support, reach our ⚡️claimr support team or email us <yo@claimr.io>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.claimr.io/api/user-token.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
