Skip to Content

createAuthlessClient

Create a token provider that always returns the public token, for Foundry resources that need no sign-in.

import { createAuthlessClient } from "@osdk/oauth";

function createAuthlessClient(): () => Promise<string>;

Returns a token provider that resolves to the string "PUBLIC" on every call. Pass it to createClient when your app reads resources that Foundry serves without authentication.

Returns

() => Promise<string>: resolves to "PUBLIC".

Example

src/client.ts
import { $ontologyRid } from "@my-app/sdk";
import { createClient } from "@osdk/client";
import { createAuthlessClient } from "@osdk/oauth";

export const client = createClient(
  "https://example.palantirfoundry.com",
  $ontologyRid,
  createAuthlessClient(),
);

See also

On this page