Reference·JavaScript · @bimworks/jssdkJavaScript

BimWorksClientFactory

Class in @bimworks/jssdk.

API catalogue · @bimworks/jssdk · Class

TypeScript#
class BimWorksClientFactory

Members#

Member Kind Description
constructor Method
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…
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.
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.
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/…
excludePlatformInfo Method Leaves the runtime and the platform out of what the clients send from now on.
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#

TypeScript#
constructor(url: string, options?: BimWorksClientFactorySettings)

Parameters#

Name Type Description
url string The URL of your BIM.works instance, for example https://bim.works
options BimWorksClientFactorySettings Optional factory settings, will use default settings when not provided

createAnonymousClient#

TypeScript#
public createAnonymousClient(): Promise<BimWorksClient<Client | null | undefined>>

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 useful for getting information about the deployed BIM.works version for example, or to simply test connectivity.

createClientWithApiToken#

TypeScript#
public createClientWithApiToken(token: string): Promise<BimWorksClient<Client | null | undefined>>

Create a new 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#

TypeScript#
public createClientWithAuth(auth: AuthToken): Promise<BimWorksClient<Client | null | undefined>>

Create a new 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 AuthToken

createClientWithUsernamePassword#

TypeScript#
public createClientWithUsernamePassword(username: string, password: string): Promise<BimWorksClient<Client | null | undefined>>

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/more stable.

Parameters#

Name Type Description
username string
password string

excludePlatformInfo#

TypeScript#
public excludePlatformInfo(): this

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

setApplication#

TypeScript#
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