Skip to main content

Class: default

Defined in: FreeqSDK.ts:40

The main entry point for interacting with the Freeq API.

Remarks

This class provides methods for authentication, accessing organisations, and retrieving API version information.

Example

const sdk = new FreeqSdk({ baseUrl: "https://api.freeq.io", apiKey: "your-api-key" });
const wallet = await sdk.signIn("user-token");
const organisations = await sdk.getOrganisations();
console.log(sdk.versions);

Constructors

Constructor

new default(options): FreeqSdk

Defined in: FreeqSDK.ts:50

Creates a new FreeqSdk instance.

Parameters

options

FreeSDKOptions

The SDK options including baseUrl and apiKey.

Returns

FreeqSdk

Accessors

versions

Get Signature

get versions(): undefined | FreeqApiVersion[]

Defined in: FreeqSDK.ts:86

Gets the available API versions after sign-in.

Returns

undefined | FreeqApiVersion[]

The array of API versions, or undefined if not signed in.

Methods

signIn()

signIn(token): Promise<Wallet>

Defined in: FreeqSDK.ts:63

Signs in to the Freeq API and returns the authenticated wallet.

Parameters

token

string

The user authentication token.

Returns

Promise<Wallet>

The authenticated Wallet instance.


getProject()

getProject(): Promise<Project>

Defined in: FreeqSDK.ts:94

Retrieves the current project instance.

Returns

Promise<Project>

A promise that resolves to the Project instance.


getOrganisations()

getOrganisations(): Promise<Organisations>

Defined in: FreeqSDK.ts:105

Retrieves the organisations collection.

Returns

Promise<Organisations>

A promise that resolves to the Organisations instance.