The Developer Platform and Typed Clients
Where the API lives and how you call it
You'll be able to
- Locate the Glean Developer Platform and the four typed client SDKs
- Instantiate a client and make a first authenticated call
Read first
Day 1 Lab
- Open the Developer Platform docs and find the four typed clients: Python, TypeScript, Java, Go.
- Install the client for your language and set your instance name and token as environment variables.
- Instantiate the client and make one read call to confirm the connection works.
- 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
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?
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.β
Authentication β Tokens, Scopes, and Identity