Skip to content

Commit

Permalink
current user distinct id
Browse files Browse the repository at this point in the history
  • Loading branch information
Lior539 committed Nov 29, 2024
1 parent 7352cbc commit 22f957f
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contents/docs/libraries/android/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ import AndroidIdentify from './\_snippets/identify.mdx'
<AndroidIdentify />

## Get the current user's distinct ID

You may find it helpful to get the current user's distinct ID. For example, to check whether you've already called `identify` for a user or not.

To do this, call `distinctId()`. This returns either the ID automatically generated by PostHog or the ID that has been passed by a call to `identify()`.

## Alias

Sometimes, you want to assign multiple distinct IDs to a single user. This is helpful when your primary distinct ID is inaccessible. For example, if a distinct ID used on the frontend is not available in your backend.
Expand Down
6 changes: 6 additions & 0 deletions contents/docs/libraries/flutter/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ import FlutterSendEvents from '../../integrate/send-events/_snippets/send-events
<FlutterIdentify />

## Get the current user's distinct ID

You may find it helpful to get the current user's distinct ID. For example, to check whether you've already called `identify` for a user or not.

To do this, call `PostHog().getDistinctId()`. This returns either the ID automatically generated by PostHog or the ID that has been passed by a call to `identify()`.

## Alias

Sometimes, you want to assign multiple distinct IDs to a single user. This is helpful when your primary distinct ID is inaccessible. For example, if a distinct ID used on the frontend is not available in your backend.
Expand Down
6 changes: 6 additions & 0 deletions contents/docs/libraries/ios/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ For more details on how to setup masking for session replay, please refer to our
<IOSIdentify />

## Get the current user's distinct ID

You may find it helpful to get the current user's distinct ID. For example, to check whether you've already called `identify` for a user or not.

To do this, call `getDistinctId()`. This returns either the ID automatically generated by PostHog or the ID that has been passed by a call to `identify()`.

## Alias

Sometimes, you want to assign multiple distinct IDs to a single user. This is helpful when your primary distinct ID is inaccessible. For example, if a distinct ID used on the frontend is not available in your backend.
Expand Down
6 changes: 6 additions & 0 deletions contents/docs/libraries/js/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ import JSIdentify from './\_snippets/identify.mdx'

<JSIdentify />

## Get the current user's distinct ID

You may find it helpful to get the current user's distinct ID. For example, to check whether you've already called `identify` for a user or not.

To do this, call `posthog.get_distinct_id()`. This returns either the ID automatically generated by PostHog or the ID that has been passed by a call to `identify()`.

## Alias

Sometimes, you want to assign multiple distinct IDs to a single user. This is helpful when your primary distinct ID is inaccessible. For example, if a distinct ID used on the frontend is not available in your backend.
Expand Down
6 changes: 6 additions & 0 deletions contents/docs/libraries/react-native/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ import ReactNativeIdentify from './\_snippets/identify.mdx'

<ReactNativeIdentify />

## Get the current user's distinct ID

You may find it helpful to get the current user's distinct ID. For example, to check whether you've already called `identify` for a user or not.

To do this, call `posthog.get_distinct_id()`. This returns either the ID automatically generated by PostHog or the ID that has been passed by a call to `identify()`.

## Alias

Sometimes, you want to assign multiple distinct IDs to a single user. This is helpful when your primary distinct ID is inaccessible. For example, if a distinct ID used on the frontend is not available in your backend.
Expand Down
31 changes: 31 additions & 0 deletions contents/docs/product-analytics/identify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,37 @@ export const splitUsersDark = "https://res.cloudinary.com/dmukukwp6/video/upload

<JSIdentifySetUserProperties/>


## Get the current user's distinct ID

You may find it helpful to get the current user's distinct ID. For example, to check whether you've already called `identify` for a user or not.

To do this, call the following:

<MultiLanguage selector="tabs">

```js-web
posthog.get_distinct_id()
```

```ios_swift
PostHogSDK.shared.getDistinctId()
```

```android_kotlin
PostHog.distinctId()
```

```react-native
PostHog.get_distinct_id()
```
```flutter
posthog().getDistinctId()
```
</MultiLanguage>

The ID returned is either the ID automatically generated by PostHog or the ID that has been passed by a call to `identify()`.

## Reset

<JSIdentifyReset/>
Expand Down

0 comments on commit 22f957f

Please sign in to comment.