The TypeScript SDK is a library used for interacting with Palantir's Ontology.
To get started, visit the developer console application on your Foundry stack, or visit our public documentation.
Do you only want to hit specific APIs or don't need a generated SDK? Check out the foundry-platform-typescript package, which provides standalone APIs to interact with Foundry directly without the need to generate ontology-specific SDKs.
See the instructions on how to get set up quickly with a frontend application in our public documentation.
Install the client and auth packages via npm:
npm install @osdk/client
npm install @osdk/oauth
Once you have generated an SDK in your Developer Console application, you need to create your token provider via OAuth. This token provider is supplied by creating the auth provider from the @osdk/oauth
package. Once you have your token provider set up, you can pass the authentication instance when creating the client.
To create a public client, you will need to create an application in the Developer Console app on your Foundry stack. You will need the client ID as well as the base URL of your Foundry stack and a redirect URL that you can configure in Developer Console.
import { createPublicOauthClient } from "@osdk/oauth";
const auth = createPublicOauthClient(
"<YOUR CLIENT ID>",
"<YOUR FOUNDRY URL>",
"http://redirect-url",
);
For more details, refer to the documentation provided in your Developer Console application.
To create a confidential client, follow the steps to create a service user in the Developer Console. You will need the client ID, client secret, and the base URL of your Foundry stack.
import { createConfidentialOauthClient } from "@osdk/oauth";
const auth = createConfidentialOauthClient(
"<YOUR CLIENT ID>",
"<YOUR CLIENT SECRET>",
"<YOUR FOUNDRY URL>",
);
For more details, refer to the public docs or documentation in the Developer Console application.
import { createClient } from "@osdk/client";
const client = createClient(
"https://stack.palantir.com",
"ri.foundry.main",
auth, // This is the auth that we created above.
);
For more details, refer to the public docs or documentation in the Developer Console application.
-
Fork the repo
-
Create a branch
-
pnpm install
-
Start dev mode:
pnpm dev
-
Add your code
-
Add a changeset
📘 Note Follow semver rules here.
- Assuming you've run
pnpm install
, runchangeset
(orpnpm exec changeset
). - The tool will split things into changed vs unchanged packages (which you may need if you decide to add changeset logs in a future PR for past features)
- Select the packages you want the changeset applied to using the arrow keys (up/down) and space-bar to "select" the package.
- Press enter to continue.
- The CLI will go through a progression of asking you which packages you previously selected need a major bump? Then a minor bump? Patch bumps assumed for remaining packages changed. Arrows and space bar to select. Enter to continue (even if you selected nothing).
- Enter a change (or press enter on empty to open your editor.)
Info Full docs on the
changesets
tool can be found at the changesets/changesets github repo. - Assuming you've run
-
If you're curious what the final build output might look like you can run
pnpm build
from root. -
Run all lint rules and tests with
pnpm check
from root.
- Install the GitHub CLI
gh auth login
to authenticate with github.compnpm install
./scripts/createReleasePr.sh