Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer Console docs: clarify that client needs to come from somewhere #1112

Open
tdeitch opened this issue Jan 23, 2025 · 0 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@tdeitch
Copy link

tdeitch commented Jan 23, 2025

Based on this Community question:

I am developing with React and OSDK and encountered an error when trying to apply an action. I copied and pasted the sample code from the API documentation into the developer console, but I received an error message indicating that there is no client name, as shown in the screenshot below.

And the response from Jeg:

It looks like this code sample does not have the client imported, you will likely need to import the client from wherever it was instantiated:

import { client } from "../client.ts";

If you’ve used a template, if you don’t have a client already, they are made using code similar to

import { createClient } from "@osdk/client";
import { createPublicOauthClient } from "@osdk/oauth";
import { $ontologyRid } from "@sample/sdk";
export const auth = createPublicOauthClient(clientId, url, redirectUrl);
export const client = createClient(url, $ontologyRid, auth);

We should give people some hint (either inline or via a link or comment) about how to instantiate the client and how to use the snippets in context.

@tdeitch tdeitch added the documentation Improvements or additions to documentation label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant