Skip to content

feat(docs): add JavaScript/TypeScript SDK quickstart#241

Merged
marythought merged 9 commits intomainfrom
feat/dspx-2649-js-quickstart
Mar 17, 2026
Merged

feat(docs): add JavaScript/TypeScript SDK quickstart#241
marythought merged 9 commits intomainfrom
feat/dspx-2649-js-quickstart

Conversation

@marythought
Copy link
Copy Markdown
Contributor

Summary

  • Replace the JS/TS SDK quickstart placeholder with a full guide mirroring the Go quickstart structure
  • Steps 1-4: project setup, SDK install, basic encrypt/decrypt, run
  • Step 5: ABAC features — namespaces, attributes, subject mappings, file I/O, streaming
  • Step 6: complete reference implementation
  • Update SDK quickstart index card from "coming soon" to active link
  • Update vendored OpenAPI specs from platform main

QA

Note

The quickstart targets the next @opentdf/sdk release which exports createTDF. Current npm 0.4.0 only has createZTDF.

Test plan

  • npm run build passes
  • Visual review via npm run start dev server
  • Re-test against SDK once next version is published to npm

🤖 Generated with Claude Code

marythought and others added 2 commits March 14, 2026 15:56
Replace the placeholder JS/TS quickstart with a full guide mirroring
the Go quickstart structure: prerequisites, project setup, basic
encrypt/decrypt, ABAC policy management, and a complete reference
implementation.

Update the SDK quickstart index card from "coming soon" to active link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@marythought marythought requested review from a team as code owners March 14, 2026 23:28
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the developer experience for JavaScript/TypeScript users by introducing a detailed and comprehensive quickstart guide for the OpenTDF SDK. This guide moves beyond basic setup to include advanced features like Attribute-Based Access Control (ABAC), file handling, and streaming, providing a robust foundation for integrating secure data protection into applications. Concurrently, the underlying API specifications have been updated to reflect the latest platform capabilities.

Highlights

  • New JavaScript/TypeScript SDK Quickstart: A comprehensive guide was added, replacing a placeholder, detailing project setup, SDK installation, basic encryption/decryption, and application execution.
  • Advanced ABAC Features Covered: The new guide includes advanced Attribute-Based Access Control (ABAC) features such as namespaces, attributes, subject mappings, file I/O, and streaming.
  • Complete Reference Implementation: A full reference implementation is provided to demonstrate practical application of the SDK's features.
  • Documentation Updates: The SDK quickstart index card was updated to link to the new JavaScript guide.
  • OpenAPI Specification Updates: Vendored OpenAPI specifications were updated to reflect the latest platform capabilities, including new policy-related schemas and namespace contexts.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/sdks/quickstart/index.mdx
    • Updated the JavaScript quickstart card text from "Under development - coming soon" to "Get Started with JavaScript".
  • docs/sdks/quickstart/javascript.mdx
    • Replaced the "Coming Soon" placeholder with a full, multi-step quickstart guide for the JavaScript/TypeScript SDK, covering prerequisites, project setup, SDK installation, basic encrypt/decrypt, ABAC features (attribute creation, subject mapping, file I/O, streaming), and a complete reference implementation.
  • specs/authorization/authorization.openapi.yaml
    • Expanded query parameters for decisionRequests.actions to include detailed namespace and grants properties.
    • Added new policy-related schemas (policy.Algorithm, policy.KasPublicKeyAlgEnum, policy.SourceType, policy.KasPublicKey, policy.KasPublicKeySet, policy.KeyAccessServer, policy.Namespace, policy.PublicKey, policy.SimpleKasKey, policy.SimpleKasPublicKey).
  • specs/authorization/v2/authorization.openapi.yaml
    • Introduced new policy-related schemas (policy.Algorithm, policy.KasPublicKeyAlgEnum, policy.SourceType, policy.KasPublicKey, policy.KasPublicKeySet, policy.KeyAccessServer, policy.Namespace, policy.PublicKey, policy.SimpleKasKey, policy.SimpleKasPublicKey) to the API definition.
  • specs/policy/actions/actions.openapi.yaml
    • Added namespace context to the Action schema.
    • Introduced namespaceId and namespaceFqn parameters to CreateActionRequest, GetActionRequest, and ListActionsRequest.
  • specs/policy/attributes/attributes.openapi.yaml
    • Incorporated namespace context into the Action schema.
  • specs/policy/objects.openapi.yaml
    • Added namespace context to the Action schema.
  • specs/policy/obligations/obligations.openapi.yaml
    • Included namespace context in the Action schema.
  • specs/policy/registeredresources/registered_resources.openapi.yaml
    • Added namespace context to the Action schema.
  • specs/policy/resourcemapping/resource_mapping.openapi.yaml
    • Incorporated namespace context into the Action schema.
  • specs/policy/subjectmapping/subject_mapping.openapi.yaml
    • Added namespace context to the Action schema.
  • specs/policy/unsafe/unsafe.openapi.yaml
    • Included namespace context in the Action schema.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable JavaScript/TypeScript SDK quickstart guide and updates several OpenAPI specifications. The new guide is a great addition for developers. My review focuses on the code examples within this new documentation. I've pointed out a couple of areas where the examples could be improved for robustness and efficiency. Specifically, the pattern for creating resources if they don't already exist can be made more efficient, and the final complete code example has a minor bug in its logic for ensuring an attribute value exists. Fixing these points will enhance the quickstart experience for new users.

Comment thread docs/sdks/quickstart/javascript.mdx
Comment thread docs/sdks/quickstart/javascript.mdx
@github-actions
Copy link
Copy Markdown
Contributor

📄 Preview deployed to https://opentdf-docs-pr-241.surge.sh

marythought and others added 5 commits March 16, 2026 11:09
- Replace listNamespaces + filter with getNamespace by FQN for
  direct lookup when namespace already exists
- Add missing 'marketing' value creation in Step 6 complete example
  when attribute exists but value doesn't

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The SDK logs a NetworkError about missing BaseKey in
WellKnownConfiguration during encryption. This is harmless — it
falls back to the legacy KAS public key endpoint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PlatformClient requires DPoP keys bound to the auth provider before
making API calls. OpenTDF generates these keys but only binds them
lazily during encrypt/decrypt — so explicit binding is needed when
PlatformClient is used before any TDF operation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolve conflict in platform-client.mdx and replace manual
updateClientPublicKey workaround with the new `await client.ready`
pattern from opentdf/web-sdk#883 across all JS/TS code samples.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread docs/sdks/quickstart/javascript.mdx Outdated
Comment thread docs/sdks/quickstart/javascript.mdx Outdated
Comment thread docs/sdks/quickstart/javascript.mdx Outdated
- Change Node.js prerequisite to "Node.js LTS" with link
- Clarify SDK supports both ESM and CommonJS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@marythought marythought merged commit f9efa5d into main Mar 17, 2026
7 checks passed
@marythought marythought deleted the feat/dspx-2649-js-quickstart branch March 17, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants