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

Install Browser/JS SDK #285

Open
CarlosPinedaT opened this issue Oct 19, 2023 · 4 comments
Open

Install Browser/JS SDK #285

CarlosPinedaT opened this issue Oct 19, 2023 · 4 comments

Comments

@CarlosPinedaT
Copy link

More than reporting a BUG or similar, this issue is a very direct question.

How do I install the SDK for a project in Angular or similar, I can start reporting to the server.

I can't finish the issue without first congratulating you for the work you have done and I hope to contribute my grain of code to the project.

I hope to have an answer, thank you

@piotr-szewczyk
Copy link
Collaborator

piotr-szewczyk commented Oct 19, 2023

Hi @CarlosPinedaT, thank you for this issue.

For now there is a possibility to use sdk for browser, but only for React and Vue. Support for Angular should be added in the future, but it highly depend on my personal amount of free time. Therefore, any support is welcome :)

@CarlosPinedaT
Copy link
Author

Hello, thanks for the answer,
Any way to integrate it with native Javascript currently?

@piotr-szewczyk
Copy link
Collaborator

Hello, thanks for the answer, Any way to integrate it with native Javascript currently?

For browser - no, for NodeJS in backend side you can use this package.

@LiHaoGit
Copy link

LiHaoGit commented Nov 9, 2023

@CarlosPinedaT

import { BrowserClient, VERSION, ClientOptions } from "@traceo-sdk/browser";
class Client extends BrowserClient {
  constructor(apiKey: string, options: ClientOptions) {
    super({
      headers: {
        "x-sdk-name": "react",
        "x-sdk-version": VERSION,
        "x-sdk-key": apiKey,
      },
      options: {
        ...options,
        apiKey,
      },
    });
  }

  public postInitSDK(): void {}
}

new Client("apiKey", { performance: false, host: "host" });

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

No branches or pull requests

3 participants