agentsclimarketplace

Palantir install auth

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/palantir-pack/skills/palantir-install-auth

'Install and configure Palantir Foundry SDK authentication with OAuth2 or token auth.From its SKILL.md

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill palantir-install-auth

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.5 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

Palantir Install & Auth

Overview

Set up the Palantir Foundry Platform SDK (Python or TypeScript) and configure authentication using either bearer tokens for development or OAuth2 client credentials for production. Covers both the Platform SDK for direct API access and the OSDK for Ontology-based workflows.

Prerequisites

  • Python 3.9+ or Node.js 18+
  • A Palantir Foundry enrollment with API access enabled
  • A third-party application registered in Developer Console (for OAuth2)
  • Your Foundry hostname (e.g., mycompany.palantirfoundry.com)

Instructions

Step 1: Install the SDK

Python (Platform SDK):

set -euo pipefail
pip install foundry-platform-sdk
python -c "import foundry; print(f'foundry-platform-sdk {foundry.__version__} installed')"

Python (OSDK for Ontology access):

set -euo pipefail
pip install palantir-sdk
python -c "import palantir; print('palantir-sdk installed')"

TypeScript (OSDK):

set -euo pipefail
npm install @osdk/client @osdk/oauth
npx tsc --version

Step 2: Configure Environment Variables

# .env — never commit this file
FOUNDRY_HOSTNAME=mycompany.palantirfoundry.com

# Option A: Bearer token (development only)
FOUNDRY_TOKEN=eyJhbGciOiJS...

# Option B: OAuth2 client credentials (production)
FOUNDRY_CLIENT_ID=abc123
FOUNDRY_CLIENT_SECRET=secret456

Step 3: Initialize with Bearer Token (Development)

import os
import foundry

client = foundry.FoundryClient(
    auth=foundry.UserTokenAuth(
        hostname=os.environ["FOUNDRY_HOSTNAME"],
        token=os.environ["FOUNDRY_TOKEN"],
    ),
    hostname=os.environ["FOUNDRY_HOSTNAME"],
)

# Verify connection — list datasets
datasets = client.datasets.Dataset.list()
for ds in datasets:
    print(f"Dataset: {ds.rid}")

Step 4: Initialize with OAuth2 (Production)

import os
import foundry

auth = foundry.ConfidentialClientAuth(
    client_id=os.environ["FOUNDRY_CLIENT_ID"],
    client_secret=os.environ["FOUNDRY_CLIENT_SECRET"],
    hostname=os.environ["FOUNDRY_HOSTNAME"],
    scopes=["api:read-data", "api:write-data"],
)
auth.sign_in_as_service_user()

client = foundry.FoundryClient(
    auth=auth,
    hostname=os.environ["FOUNDRY_HOSTNAME"],
)

# Verify — fetch ontology metadata
ontologies = client.ontologies.Ontology.list()
for ont in ontologies:
    print(f"Ontology: {ont.api_name} (rid={ont.rid})")

Step 5: TypeScript OSDK Setup

import { createClient } from "@osdk/client";
import { createConfidentialOauthClient } from "@osdk/oauth";

const oauthClient = createConfidentialOauthClient(
  process.env.FOUNDRY_CLIENT_ID!,
  process.env.FOUNDRY_CLIENT_SECRET!,
  `https://${process.env.FOUNDRY_HOSTNAME}/multipass/api/oauth2/token`,
);

const client = createClient(
  `https://${process.env.FOUNDRY_HOSTNAME}`,
  "<your-ontology-rid>",
  oauthClient,
);

Step 6: Generate Credentials via Developer Console

1. Navigate to https://<hostname>/workspace/developer-console
2. Create a new application > select "Server application"
3. Grant scopes: api:read-data, api:write-data, api:ontology-read
4. Copy client_id and client_secret
5. For quick testing: generate a personal access token under Settings > Tokens

Output

  • SDK installed and importable (foundry-platform-sdk or @osdk/client)
  • Environment variables configured for your Foundry enrollment
  • Authenticated client verified against the Foundry API
  • Ontology or dataset listing confirms read access

Error Handling

ErrorCauseSolution
401 UnauthorizedToken expired or invalidRegenerate token in Developer Console
403 ForbiddenInsufficient scopesAdd required scopes: api:read-data
ConnectionErrorWrong hostnameVerify FOUNDRY_HOSTNAME has no https:// prefix
ModuleNotFoundError: foundrySDK not installedpip install foundry-platform-sdk (full name)
SSL certificate verify failedCorporate proxy/VPNSet REQUESTS_CA_BUNDLE env var

Examples

SDK Comparison

SDKPackageUse Case
Platform SDKfoundry-platform-sdkDirect REST: datasets, branches, files, builds
Python OSDKpalantir-sdkOntology objects, actions, queries, links
TypeScript OSDK@osdk/clientFrontend/Node.js Ontology access

Resources

Next Steps

Proceed to palantir-hello-world for your first Ontology query, or palantir-local-dev-loop for development workflow.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.