Client error in React with OSDK

Hi,

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.

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);

Thank you for your help! The website is now functioning well.

However, I encountered another issue. When I click the “Action” button, which hyperlinks to another site, I receive an authorization error with the warning “Invalid parameter: redirect_uri.”

This issue does not appear in the VS Code preview screen but occurs on the deployed website.

Do you have any solutions for this?