← Glean-ia-acs Β· Day 43 of 56
Level 400 β€” Builder Β· APIs30 minNIST MAP

The Developer Platform and Typed Clients

Where the API lives and how you call it

You'll be able to

Read first

Day 1 Lab

  1. Open the Developer Platform docs and find the four typed clients: Python, TypeScript, Java, Go.
  2. Install the client for your language and set your instance name and token as environment variables.
  3. Instantiate the client and make one read call to confirm the connection works.
  4. Note what the client gives you that raw HTTP would not: typed models, retries, and auth handling.

Working Example: Instantiate the Client

The typed client wraps authentication, the base URL for your instance, and the request/response models so each API surface is a typed method. Verified against developer_platform.

import os
from glean import Glean

# The client reads your instance and token; never hard-code the token.
client = Glean(
    instance=os.environ["GLEAN_INSTANCE"],   # e.g. "acme"
    api_token=os.environ["GLEAN_API_TOKEN"],
)

# A first call: typed in, typed out β€” no manual JSON, no manual URLs.
results = client.client.search.query(query="onboarding checklist", page_size=5)

for r in results.results:
    print(r.title, "->", r.url)

The same shape exists in TypeScript, Java, and Go: one Glean(...) client, authenticated once, every surface a typed call. Verified against developer_platform.

Check for understanding

Name the four typed clients Glean ships and one reason to prefer a typed client over raw HTTP.

Check yourself

Pick an answer β€” you'll see if it's right and why.

1. Which set of languages does Glean ship typed Developer Platform clients for?

2. Why does a user-scoped token return different results for two different users running the same query?

3. In a Chat API response, what do the citations tell you?

4. You need to make 10,000 support tickets searchable in Glean. Which API do you use?

5. When pushing documents through the Indexing API, why must you include permission metadata?

Pass threshold 80% Β· week 7 quiz

In 10 seconds

β€œGlean's Developer Platform exposes the same graph the UI uses β€” through typed clients for Python, TypeScript, Java, and Go. One client object, authenticated once, and every API surface is a method call away.”

Next Β· Week 7 Day 2
Authentication β€” Tokens, Scopes, and Identity