---
title: BimWorksClientFactory
summary: Class in @bimworks/jssdk.
order: 10
languages: [javascript]
sdk-package: JavaScript · @bimworks/jssdk
---

# BimWorksClientFactory

[[page:reference/javascript/api|API catalogue]] · `@bimworks/jssdk` · Class

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
class BimWorksClientFactory
````



## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/bimworks-jssdk/bimworksclientfactory-94c89f24#member-constructor-2c01d7ecb826|constructor]] | Method |  |
| [[page:reference/javascript/bimworks-jssdk/bimworksclientfactory-94c89f24#member-createanonymousclient-d56ea75cb6f3|createAnonymousClient]] | Method | Create an anonymous BIM.works client. The returned BimWorksClient will usually not be very usefull as anonymous users can't do much in BIM.works. This can be… |
| [[page:reference/javascript/bimworks-jssdk/bimworksclientfactory-94c89f24#member-createclientwithapitoken-a5c3b3e15304|createClientWithApiToken]] | Method | Create a new BimWorksClient based on the provided API Token. Please refer to generic BIM.works documentation about how to create API Tokens. |
| [[page:reference/javascript/bimworks-jssdk/bimworksclientfactory-94c89f24#member-createclientwithauth-183e62d9e9fb|createClientWithAuth]] | Method | Create a new BimWorksClient based on the provided Auth Token. Please refer to generic BIM.works documentation about how to create Auth Tokens. |
| [[page:reference/javascript/bimworks-jssdk/bimworksclientfactory-94c89f24#member-createclientwithusernamepassword-d2f240435726|createClientWithUsernamePassword]] | Method | Create a new BimWorksClient based on the provided username/password. This method is not recommended, on most cases using an API Token or Auth Token is safer/… |
| [[page:reference/javascript/bimworks-jssdk/bimworksclientfactory-94c89f24#member-excludeplatforminfo-c2e9011f17bc|excludePlatformInfo]] | Method | Leaves the runtime and the platform out of what the clients send from now on. |
| [[page:reference/javascript/bimworks-jssdk/bimworksclientfactory-94c89f24#member-setapplication-5d82fe7a87da|setApplication]] | Method | Names your application, sent with every request from now on (the `app` of the X-BIMworks-Client header). It tells BIM.works support which of your integration… |

## `constructor` {#member-constructor-2c01d7ecb826}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
constructor(url: string, options?: BimWorksClientFactorySettings)
````



### Parameters

| Name | Type | Description |
|---|---|---|
| `url` | `string` | The URL of your BIM.works instance, for example https://bim.works |
| `options` | [[page:reference/javascript/bimworks-jssdk/bimworksclientfactorysettings-a891ad51|BimWorksClientFactorySettings]] | Optional factory settings, will use default settings when not provided |

## `createAnonymousClient` {#member-createanonymousclient-d56ea75cb6f3}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public createAnonymousClient(): Promise<BimWorksClient<Client | null | undefined>>
````

Create an anonymous BIM.works client. The returned [[page:reference/javascript/bimworks-jssdk/bimworksclient-40a172f2|BimWorksClient]] will usually not be very usefull as anonymous users can't do much in BIM.works.
This can be useful for getting information about the deployed BIM.works version for example, or to simply test connectivity.

## `createClientWithApiToken` {#member-createclientwithapitoken-a5c3b3e15304}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public createClientWithApiToken(token: string): Promise<BimWorksClient<Client | null | undefined>>
````

Create a new [[page:reference/javascript/bimworks-jssdk/bimworksclient-40a172f2|BimWorksClient]] based on the provided API Token. Please refer to generic BIM.works documentation about how to create API Tokens.

### Parameters

| Name | Type | Description |
|---|---|---|
| `token` | `string` |  |

## `createClientWithAuth` {#member-createclientwithauth-183e62d9e9fb}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public createClientWithAuth(auth: AuthToken): Promise<BimWorksClient<Client | null | undefined>>
````

Create a new [[page:reference/javascript/bimworks-jssdk/bimworksclient-40a172f2|BimWorksClient]] based on the provided Auth Token. Please refer to generic BIM.works documentation about how to create Auth Tokens.

### Parameters

| Name | Type | Description |
|---|---|---|
| `auth` | [[page:reference/javascript/sascom-jsclient/authtoken-3d7f8997|AuthToken]] |  |

## `createClientWithUsernamePassword` {#member-createclientwithusernamepassword-d2f240435726}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public createClientWithUsernamePassword(username: string, password: string): Promise<BimWorksClient<Client | null | undefined>>
````

Create a new [[page:reference/javascript/bimworks-jssdk/bimworksclient-40a172f2|BimWorksClient]] based on the provided username/password. This method is not recommended, on most cases using an API Token or Auth Token is safer/more stable.

### Parameters

| Name | Type | Description |
|---|---|---|
| `username` | `string` |  |
| `password` | `string` |  |

## `excludePlatformInfo` {#member-excludeplatforminfo-c2e9011f17bc}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public excludePlatformInfo(): this
````

Leaves the runtime and the platform out of what the clients send from now on.

## `setApplication` {#member-setapplication-5d82fe7a87da}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public setApplication(name: string, version?: string | null): this
````

Names your application, sent with every request from now on (the `app` of the X-BIMworks-Client header). It
tells BIM.works support which of your integrations made a call. Letters, digits and `. _ + -`.

### Parameters

| Name | Type | Description |
|---|---|---|
| `name` | `string` |  |
| `version` | `string \| null` |  |
