@lookingglass/blocks.js
- AuthClientOptions
- BlocksClientArgs
- CreateHologramFromImageInput
- CreateQuiltHologramInputType
- GraphqlDocument
- UpdateHologramInput
- VerifySessionQuery
- createAuthClient
- getToken
- isAuthenticated
- loginWithRedirect
- logout
- logoutWithRedirect
- validateSession
Ƭ AuthClientOptions: Omit
<Auth0ClientOptions
, "domain"
> & { domain?
: string
}
Ƭ BlocksClientArgs: Object
Name | Type | Description |
---|---|---|
apiUrl? |
string |
Change the API url if you're using a self-hosted version of Blocks Default https://blocks.glass |
token |
string | null |
The JWT token that's used to authenticate with the Blocks API |
Ƭ CreateHologramFromImageInput: Object
The input arguments for the createHologram mutation.
Name | Type | Description |
---|---|---|
description? |
InputMaybe <Scalars ["String" ]["input" ]> |
- |
imageUrl |
Scalars ["String" ]["input" ] |
The public URL of the image to be converted to RGBD. |
privacy? |
InputMaybe <PrivacyType > |
- |
title? |
InputMaybe <Scalars ["String" ]["input" ]> |
- |
Ƭ CreateQuiltHologramInputType: Object
The input arguments for the createQuiltHologram mutation.
Name | Type | Description |
---|---|---|
aspectRatio? |
InputMaybe <Scalars ["Float" ]["input" ]> |
- |
description? |
InputMaybe <Scalars ["String" ]["input" ]> |
- |
imageUrl |
Scalars ["String" ]["input" ] |
The URL of the image |
isPublished? |
InputMaybe <Scalars ["Boolean" ]["input" ]> |
- |
privacy? |
InputMaybe <PrivacyType > |
Restricted |
quiltCols? |
InputMaybe <Scalars ["Int" ]["input" ]> |
- |
quiltRows? |
InputMaybe <Scalars ["Int" ]["input" ]> |
- |
quiltTileCount? |
InputMaybe <Scalars ["Int" ]["input" ]> |
- |
title? |
InputMaybe <Scalars ["String" ]["input" ]> |
- |
Ƭ GraphqlDocument: RequestDocument
| TypedQueryDocumentNode
<any
, Variables
> | string
Ƭ UpdateHologramInput: Object
The input arguments for the updateHologram mutation.
Name | Type |
---|---|
aspectRatio? |
InputMaybe <Scalars ["Float" ]["input" ]> |
description? |
InputMaybe <Scalars ["String" ]["input" ]> |
id |
Scalars ["Int" ]["input" ] |
isPublished? |
InputMaybe <Scalars ["Boolean" ]["input" ]> |
privacy? |
InputMaybe <PrivacyType > |
quiltCols? |
InputMaybe <Scalars ["Int" ]["input" ]> |
quiltRows? |
InputMaybe <Scalars ["Int" ]["input" ]> |
quiltTileCount? |
InputMaybe <Scalars ["Int" ]["input" ]> |
rgbdDepthiness? |
InputMaybe <Scalars ["Float" ]["input" ]> |
rgbdFocus? |
InputMaybe <Scalars ["Float" ]["input" ]> |
rgbdStretch? |
InputMaybe <Scalars ["Float" ]["input" ]> |
rgbdZoom? |
InputMaybe <Scalars ["Float" ]["input" ]> |
title? |
InputMaybe <Scalars ["String" ]["input" ]> |
Ƭ VerifySessionQuery: Object
Name | Type |
---|---|
__typename? |
"Query" |
me? |
{ __typename? : "User" ; displayName : string ; email? : string | null ; id : number ; username : string } | null |
• Const
HOLOGRAM_QUILT_IMAGE_FORMATS: string
[]
Default Value
["png", "jpg", "jpeg", "webp", "bmp"]
• Const
HOLOGRAM_QUILT_IMAGE_MIMETYPES: string
[]
Default Value
["image/png", "image/jpg", "image/jpeg", "image/webp", "image/bmp"]
▸ createAuthClient(options
): Auth0Client
Create a new Auth0Client with default Blocks API configuration
const authClient = createAuthClient({
clientId: "BLOCKS_CLIENT_ID_HERE",
})
Name | Type |
---|---|
options |
AuthClientOptions |
Auth0Client
▸ getToken(): string
Returns the token from the session. This is just fetching it from cache. If you are wanting to validate a new sign in see validateSession
string
▸ isAuthenticated(): boolean
Returns if the user is logged in or not
boolean
▸ loginWithRedirect(authClient
, redirectUri
): Promise
<void
>
Redirects the user to the Auth0 login page. Use this to sign in users. When the user is redirected back to your app, you can use validateSession to validate the session.
Name | Type |
---|---|
authClient |
Auth0Client |
redirectUri |
string |
Promise
<void
>
▸ logout(authClient
, enableRedirect?
): Promise
<void
>
Signs the user out
Name | Type | Default value |
---|---|---|
authClient |
Auth0Client |
undefined |
enableRedirect |
boolean |
true |
Promise
<void
>
▸ logoutWithRedirect(authClient
, redirectURL
): Promise
<void
>
Name | Type |
---|---|
authClient |
Auth0Client |
redirectURL |
string |
Promise
<void
>
▸ validateSession(authClient
): Promise
<string
| null
>
Validates the session with Auth0 and returns the token if it exists.
Name | Type |
---|---|
authClient |
Auth0Client |
Promise
<string
| null
>