Types

List of common types that would be necessary for the props on the various components and hooks provided.

ThreekitAuthProps

Authentication type to pass to the Viewer and ConfiguratorProvider components

type ThreekitAuthProps = {
  orgId: string;
  host: string;
  publicToken: string;
  branch?: string | undefined;
} | {
  orgId: string;
  host: string;
  privateToken: string;
  branch?: string | undefined;
} | {
  orgId: string;
  host: string;
  cookie: string;
  branch?: string | undefined;
}

Example

const auth = {
  orgId: "YOUR_ORG_ID",
  host: "preview.threekit.com",
  publicToken: "YOUR_PUBLIC_TOKEN",
};

Configuration

A mapping of attribute names to attribute values.

This needs to be imported from "@threekit/rest-api" if you have it installed.

type Configuration = {
    [attributeName: string]: string | number | boolean | {
        r: number;
        g: number;
        b: number;
    } | {
        type?: string | undefined;
        assetId: string;
        configuration?: string | Configuration | undefined;
    } | {
        type?: string | undefined;
        assetId: string;
        configuration?: string | ... 1 more ... | undefined;
    }[] | null;
}

Example

const config: Configuration = {  
  Fabric: { type: "item", assetId: "319635b7-735b-437c-b4ec-4e28789f89a2" },
  Legs: { type: "item", assetId: "7dd1c8a9-e0e0-4a22-8e3c-a29a37a6d68e" },
};

ExporterSettings

Settings used by the gltf exporter when exporting scene assets.

Example

type ExporterSettings = {
  arExport?: boolean;
  prune?: {
    invisible?: boolean;
    childless?: boolean;
    lights?: boolean;
    environment?: boolean;
  };
};