> ## Documentation Index
> Fetch the complete documentation index at: https://docs.radar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up organizations, projects, accounts, and authentication

> Set up a Radar organization and project, give teammates the least access they need, choose the right API keys, and find the data retention and deletion controls.

This page gets you a project with Test and Live environments, teammates invited with the least access they need, and the correct key in each part of your stack.

A project is one app, with its own settings and API keys. A user is an end user or device in your app, and never signs in to the dashboard.

## Set up a project and its environments

Sign in to the [Radar dashboard](https://dashboard.radar.com) and open the [Settings](https://dashboard.radar.com/settings) page for your project. Every project has two environments, Test and Live, and the dashboard shows data for the one you select. Do all integration work in Test.

Use a separate project when two apps must not share geofences, settings, keys, or user data.

## Choose the right API key

Each environment has its own data and its own pair of keys.

| Key | Prefix | Where to use it |
| - | - | - |
| Test publishable | `prj_test_pk_` | Client code in development and staging builds. |
| Live publishable | `prj_live_pk_` | Client code in production builds. |
| Test secret | `prj_test_sk_` | Your backend only, against Test data. |
| Live secret | `prj_live_sk_` | Your backend only, against Live data. |

Keys are on the Settings page under **API keys**, visible to the Admin and Owner roles.

* **Publishable keys**: Safe to ship in client code. They can call only the endpoints marked `Publishable` in the [API reference](https://docs.radar.com/api/fundamentals.md).
* **Secret keys**: Can read and write project data. Load them from a secret store or environment variable, and never put one in a mobile app, a web page, or a source repository.

From your backend, send the secret key in the `Authorization` header:

```bash theme={null}
curl "https://api.radar.io/v1/users" \
  -H "Authorization: prj_test_sk_..."
```

### Restrict where publishable keys can be used

On the Settings page:

* Under **Website restrictions**, add the domains allowed to use your publishable keys. Wildcards are supported, for example `example.com`, `*.example.com`, and `localhost:8080`.
* Under **Mobile restrictions**, add the iOS bundle IDs and Android package names allowed to use them, for example `com.example.app`. Wildcards aren't supported.

### Rotate a key

Only an Owner can reset a key: under **API keys**, click **Reset key**. A reset replaces the key, so replacing a publishable key can require an app release. Rotate a secret key immediately if it appears in client code, logs, a ticket, or a source repository.

### Use auth tokens instead of a publishable key

For verified location checks, you can initialize the SDK with a short-lived auth token that your backend signs, instead of a publishable key. Auth tokens must be enabled for your project. See [Authenticate the SDK with auth tokens](https://docs.radar.com/sdk/fraud.md#authenticate-the-sdk-with-auth-tokens).

## Sign in to the dashboard

* **Email and password**: Passwords need at least 10 characters with upper-case and lower-case letters, a number, and a symbol.
* **Multi-factor authentication (MFA)**: Turn it on from the [Account](https://dashboard.radar.com/account) page, with an authenticator app or SMS.
* **Single sign-on (SSO)**: Available on the [Enterprise plan](https://radar.com/pricing), with SAML, LDAP, OpenID, and other identity providers. Your Radar account team turns it on.

## Invite teammates

You need the Admin or Owner role. On the [Organization](https://dashboard.radar.com/organization) page, click **Invite**, enter the teammate's email, and select a **Role**. For Read and Write accounts, select **Environment access**: Test, Live, or Test and live. Deleting an account ends its dashboard sessions.

## Roles and what each can do

Each built-in role includes everything the role before it can do.

| Action | Read | Write | Admin | Owner |
| - | - | - | - | - |
| View users, geofences, events, and location data | Yes | Yes | Yes | Yes |
| View saved reports | Yes | Yes | Yes | Yes |
| Create and edit geofences | No | Yes | Yes | Yes |
| Create, save, and delete reports and report subscriptions | No | Yes | Yes | Yes |
| Create block rules | No | Yes | Yes | Yes |
| Create and edit bypass rules | No | No | Yes | Yes |
| Delete block and bypass rules | No | No | Yes | Yes |
| Set test overrides on a user | No | No | Yes | Yes |
| Invite accounts | No | No | Yes | Yes |
| Change project settings, integrations, and webhooks | No | No | Yes | Yes |
| View API keys | No | No | Yes | Yes |
| View and export audit logs | No | No | Yes | Yes |
| Create and edit custom roles | No | No | Yes | Yes |
| Delete custom roles | No | No | No | Yes |
| Reset API keys and manage auth token public keys | No | No | No | Yes |
| Change data retention settings | No | No | No | Yes |

Owners can edit any other account's role and project access, and only an Owner can delete another Owner's account. No account can change its own role.

### Limit access to location data with custom roles

On the Enterprise plan, create a custom role in the **Roles** section of the Organization page. It sets a base access level, environment access, access to user and trip locations, and geofence access by tag and external ID.

### Review account activity with audit logs

On the Enterprise plan, audit logs record each request made from the dashboard with the account, project, environment, IP address, and timestamp. You can export them to CSV.

## Identify the users in your app

After `Radar.initialize()`, call `Radar.setUserId()` with your own stable ID as soon as you know who the user is. Until then, Radar identifies the device by `installId` and `deviceId`.

```swift Swift theme={null}
import RadarSDK

Radar.setUserId("user-123")
```

```kotlin Kotlin theme={null}
import io.radar.sdk.Radar

Radar.setUserId("user-123")
```

```javascript JavaScript theme={null}
import Radar from 'radar-sdk-js';

Radar.setUserId('user-123');
```

```javascript React Native theme={null}
import Radar from 'react-native-radar';

Radar.setUserId('user-123');
```

```dart Flutter theme={null}
import 'package:flutter_radar/flutter_radar.dart';

await Radar.setUserId('user-123');
```

> [!WARNING]
>
> Use an opaque internal ID such as `user-123`. Never send a name, email address, phone number, or any publicly known identifier as the `userId`.

The SDK keeps the `userId` across app sessions. It appears as **External ID** in the dashboard.

### Handle login, logout, and user switching

Call `Radar.setUserId()` with the new ID whenever a user logs in. A different user who logs in on the same device gets their own user record.

`userId` is nullable. At logout, you can clear it by passing `nil` in Swift or `null` in Kotlin, or by calling `Radar.setUserId()` with no argument in JavaScript.

### How Radar counts users

* **User record**: One exists for each unique combination of `installId`, `deviceId`, and `userId`.
* **Tracked user**: A unique user that sends one or more location events to Radar in a given period.
* **Active user**: A unique user with an app session in a given period. A new app session starts when the app is opened and at least 5 minutes have passed since the last session started.

## Control what data Radar keeps

### What the SDK collects

By default the SDK collects location, device IDs, IP address, and device information. Radar also stores any user ID and metadata you choose to send. The SDK calls the Radar API over HTTPS with TLS 1.2 or later.

### Find and change data retention

Retention settings are on the [Privacy](https://dashboard.radar.com/privacy) page, under **Data retention**. New projects start with these values:

| Data | Default retention |
| - | - |
| Users | 1 year |
| Events | 1 year |
| Trips | 90 days |
| User locations | 7 days |
| API calls | 1 year |

On the Enterprise plan, an Owner can select a different period for each data type. Settings apply to both Test and Live and can take up to 24 hours to take effect. On some accounts, retention is managed by Radar and the controls are read-only.

### Export data

Export one user with their events and locations from the user detail page. Export lists of locations, users, events, geofences, and trips from the dashboard. Every list except locations requires the Write role or above. For scheduled exports, see [Create, save, and subscribe to reports](https://docs.radar.com/fundamentals/testing-and-launch.md#create-save-and-subscribe-to-reports).

### Delete data

Delete a user from the user detail page, or with the [Users API](https://docs.radar.com/api/users.md). Deletion is immediate.

## Security and compliance

* Radar maintains SOC 1 Type II and SOC 2 Type II attestations. You can request the most current reports in the Radar Trust Center at [trust.radar.com](https://trust.radar.com).
* Radar supports CCPA and GDPR requests through the export and delete controls.
* To report a potential vulnerability, email [security@radar.com](mailto:security@radar.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.