> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Multiple AppIDs support

#### v2.x

The SDK has support for multiple AppIDs. If your app communicates with multiple servers which have different AppIDs you should make sure that the correct headers are sent to each server.

You can configure multiple AppIDs for the HUMAN SDK, by calling the `PerimeterX/start(appId:delegate:enableDoctorCheck:completion:)` function for each AppID you have.

When using multiple AppIDs, you should:

1. Specify the relevant AppID anytime you call functions in the HUMAN SDK.
2. Set the domain list in the policy for each AppID. Here is an example:

```swift
let policyForAppId1 = PXPolicy()
policyForAppId1.domains.insert("my-domain-1.com")
PerimeterX.setPolicy(policy: policyForAppId1, forAppId: "<APP_ID_1>", completion: nil)

let policyForAppId2 = PXPolicy()
policyForAppId2.domains.insert("my-domain-2.com")
PerimeterX.setPolicy(policy: policyForAppId2, forAppId: "<APP_ID_2>", completion: nil)
```

```objectivec
PXPolicy *policyForAppId1 = [[PXPolicy alloc] init];
policyForAppId1.domains = [NSSet setWithObject:@"my-domain-1.com"];
[PerimeterX setPolicyWithPolicy:policyForAppId1 forAppId:@"<APP_ID_1>" completion:nil];

PXPolicy *policyForAppId2 = [[PXPolicy alloc] init];
policyForAppId2.domains = [NSSet setWithObject:@"my-domain-2.com"];
[PerimeterX setPolicyWithPolicy:policyForAppId2 forAppId:@"<APP_ID_2>" completion:nil];
```