# Contact Profiles

Using Bird SDKs in your applications, you can identify the user as a *contact* in BirdCRM.

## Anonymous Contact

When the web or mobile application starts, it already creates an anonymous contact. Having this anonymous contact is useful to support [Push Notifications](/api/client-sdks/push-notifications.md) even before any user logs in.

Example use cases:

* You get insights on which pages anonymous users visit or which products they put in their cart.
* You can send a push notification campaign to all anonymous contacts.
* You can build a journey to send Push Notifications to anonymous users who abandoned their carts to remind them to checkout.

## Providing Contact Identifier

When the user logs in on your website or mobile app, you can identify the user with a unique identifier from your system. For example, the `userId` could be used in this case.

Here how to provide a contact identifier:

{% tabs %}
{% tab title="Android (Kotlin)" %}

```kotlin
bird.contact.identify( ExternalIdentifier("external_id", userId) )
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
bird.contact.identify(externalid: userId)
```

{% endtab %}

{% tab title="Web (Js)" %}

<pre class="language-javascript"><code class="lang-javascript">// Identify as anonymous visitor
await Bird.contact.identify({ strategy: 'Visitor' });

<strong>// Or identify with a known identifier
</strong>await Bird.contact.identify({
  strategy: 'Visitor',
  identifier: {
    key: 'emailaddress',
    value: 'user@email.com',
  },
});
</code></pre>

{% endtab %}
{% endtabs %}

### Signed Identity

Signed Identity is a more secure way to provide contact identifiers. When the user logs in on your website or mobile app, your backend server will return a signed payload containing the identifiers for this user. This signed payload is called `SignedIdentity`. Take a look at the following sequence diagram:

<figure><img src="/files/5gXTBB5ULRlR3CSAejoh" alt="" width="375"><figcaption></figcaption></figure>

Here is how this sequence look like in code on the client application:

{% tabs %}
{% tab title="Android (Kotlin)" %}

```kotlin
// Call backend server for user login
val response = userLogin()

// and get signed identity
val signedIdentity = response.signedIdentity

bird.contact.identify( SignedIdentity(signedIdentity) )
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
// Call backend server for user login
let response = userLogin()

// and get signed identity
let signedIdentity = response.signedIdentity

bird.contact.identify(signedIdentity: signedIdentity)
```

{% endtab %}

{% tab title="Web (Js)" %}

```javascript
// Call your authenticated backend to get a signed identity
// Your backend must verify the user's session before issuing the JWT
const resp = await fetch('/api/bird-identity', {
  method: 'POST',
  credentials: 'include', // sends session cookies for authentication
});
const { signedIdentity } = await resp.json();

await Bird.contact.identify({
  strategy: 'SignedIdentityClaims',
  signedIdentity: signedIdentity,
});
```

{% endtab %}
{% endtabs %}

Read more about how to [generate Signed Identity](/api/client-sdks/contact-profiles/signed-identity.md).

## Contact Attributes

You can add any user properties as attributes on the contact. This allows you to create audiences by filtering on those attributes.

{% tabs %}
{% tab title="Android (Kotlin)" %}

```kotlin
val attributes = Attributes()
    .put("displayName", name)
    .put("subscribedPush", true)
    .put("subscribedAppInbox", true)
bird.contact.putAttributes(attributes)
```

{% endtab %}

{% tab title="iOS (Swift)" %}

```swift
let attributes = BirdKit.Attributes()
                     .put("displayName", name)
                     .put("subscribedPush", true)
                     .put("subscribedAppInbox", true)
bird.contact.putAttributes(attributes: attributes)
```

{% endtab %}

{% tab title="Web (Js)" %}

```javascript
await Bird.contact.putAttributes({
  displayName: name,
  subscribedPush: true,
  subscribedAppInbox: true,
});
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.bird.com/api/client-sdks/contact-profiles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
