OdspClient Class
OdspClient provides the ability to have a Fluid object backed by the ODSP service within the context of Microsoft 365 (M365) tenants.
To use, import via @fluidframework/odsp-client/beta.
For more information about our API support guarantees, see here.
This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.
Signature
/** @sealed */
export declare class OdspClient
Constructors
| Constructor | Alerts | Description |
|---|---|---|
| (constructor)(properties) | Beta | Constructs a new instance of the OdspClient class |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| createContainer(containerSchema, minVersionForCollab) | Beta | Promise<{ container: IOdspFluidContainer<T>; services: IOdspContainerServices; }> | Creates a new detached container instance backed by ODSP. |
| createContainer(containerSchema) | Deprecated, Beta | Promise<{ container: IOdspFluidContainer<T>; services: IOdspContainerServices; }> | Creates a new detached container instance backed by ODSP. |
| getContainer(id, containerSchema, minVersionForCollab) | Beta | Promise<{ container: IOdspFluidContainer<T>; services: IOdspContainerServices; }> | Accesses an existing container by its unique ID in ODSP. |
| getContainer(id, containerSchema) | Deprecated, Beta | Promise<{ container: IOdspFluidContainer<T>; services: IOdspContainerServices; }> | Accesses an existing container by its unique ID in ODSP. |
Constructor Details
(constructor)
Constructs a new instance of the OdspClient class
For more information about our API support guarantees, see here.
Signature
constructor(properties: OdspClientProps);
Parameters
| Parameter | Type | Description |
|---|---|---|
| properties | OdspClientProps |
Method Details
createContainer
Creates a new detached container instance backed by ODSP.
For more information about our API support guarantees, see here.
Signature
createContainer<T extends ContainerSchema>(containerSchema: T, minVersionForCollab: Exclude<MinimumVersionForCollab, `1.${string}`>): Promise<{
container: IOdspFluidContainer<T>;
services: IOdspContainerServices;
}>;
Type Parameters
| Parameter | Constraint | Description |
|---|---|---|
| T | ContainerSchema |
Parameters
| Parameter | Type | Description |
|---|---|---|
| containerSchema | T | Container schema for the new container. |
| minVersionForCollab | Exclude<MinimumVersionForCollab, `1.${string}`> | Minimum Fluid Framework version required for collaboration, as a MinimumVersionForCollab SemVer string (e.g. "2.100.0"). Prefer the current Fluid Framework version so the container opts into the latest defaults. |
Returns
New detached container instance along with associated services.
Return type: Promise<{ container: IOdspFluidContainer<T>; services: IOdspContainerServices; }>
createContainer
Creates a new detached container instance backed by ODSP.
Pass a MinimumVersionForCollab SemVer string (e.g. "2.0.0") as a second argument. The previous behavior was equivalent to passing "2.0.0".
For more information about our API support guarantees, see here.
Signature
createContainer<T extends ContainerSchema>(containerSchema: T): Promise<{
container: IOdspFluidContainer<T>;
services: IOdspContainerServices;
}>;
Type Parameters
| Parameter | Constraint | Description |
|---|---|---|
| T | ContainerSchema |
Parameters
| Parameter | Type | Description |
|---|---|---|
| containerSchema | T | Container schema for the new container. |
Returns
New detached container instance along with associated services.
Return type: Promise<{ container: IOdspFluidContainer<T>; services: IOdspContainerServices; }>
getContainer
Accesses an existing container by its unique ID in ODSP.
For more information about our API support guarantees, see here.
Signature
getContainer<T extends ContainerSchema>(id: string, containerSchema: T, minVersionForCollab: Exclude<MinimumVersionForCollab, `1.${string}`>): Promise<{
container: IOdspFluidContainer<T>;
services: IOdspContainerServices;
}>;
Type Parameters
| Parameter | Constraint | Description |
|---|---|---|
| T | ContainerSchema |
Parameters
| Parameter | Type | Description |
|---|---|---|
| id | string | Unique ID of the container in ODSP. |
| containerSchema | T | Container schema used to access data objects in the container. |
| minVersionForCollab | Exclude<MinimumVersionForCollab, `1.${string}`> | Minimum Fluid Framework version required for collaboration, as a MinimumVersionForCollab SemVer string (e.g. "2.100.0"). Prefer the current Fluid Framework version so the container opts into the latest defaults. |
Returns
Existing container instance along with associated services.
Return type: Promise<{ container: IOdspFluidContainer<T>; services: IOdspContainerServices; }>
getContainer
Accesses an existing container by its unique ID in ODSP.
Pass a MinimumVersionForCollab SemVer string (e.g. "2.0.0") as a third argument. The previous behavior was equivalent to passing "2.0.0".
For more information about our API support guarantees, see here.
Signature
getContainer<T extends ContainerSchema>(id: string, containerSchema: T): Promise<{
container: IOdspFluidContainer<T>;
services: IOdspContainerServices;
}>;
Type Parameters
| Parameter | Constraint | Description |
|---|---|---|
| T | ContainerSchema |
Parameters
| Parameter | Type | Description |
|---|---|---|
| id | string | Unique ID of the container in ODSP. |
| containerSchema | T | Container schema used to access data objects in the container. |
Returns
Existing container instance along with associated services.
Return type: Promise<{ container: IOdspFluidContainer<T>; services: IOdspContainerServices; }>