Git Product home page Git Product logo

javascriptsdk's People

Contributors

mslepko avatar pichfl avatar timidak avatar winsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

javascriptsdk's Issues

javascript sdk not working at all

tried both ways exactly as described in the docs: importing the sdk via a script tag in the header of a site and importing the npm package and then building the site.

header script tag: no errors come up and the network tab shows:

Request URL: https://unpkg.com/@telemetrydeck/sdk/dist/telemetrydeck.min.js
Request Method: GET
Status Code: 302 
Remote Address: [2606:4700::6810:7aaf]:443
Referrer Policy: strict-origin-when-cross-origin

no payload is sent

npm import:

import { TelemetryDeck } from 'telemetry-deck';

throws an error "dependency not found"

System: node 14.17.0, npm 7.24.0, vue with nuxt 2.15.7

USER_IDENTIFIER should be optional

I used the JavascriptSDK on a website where I don't have a user identifier (and don't want to have one). When reading the documentation at https://telemetrydeck.com/docs/guides/javascript-setup/ , I saw the section Optional: User Identifiers and the sentence If you have none, consider anonymous.

I assumed that I could avoid to give a user and simply use something like:

td.push(["app", YOUR_APP_ID], ["signal"]);

This resulted in an error:

Error

See corresponding documentation:

Documentation

I would expect not to have an error if you pass no user. The backend should automatically assign a signal with no user to an anonymous user.

Error loading script

Hi ๐Ÿ‘‹ ,

While following the guide at https://telemetrydeck.com/docs/guides/javascript-setup/ I added the TD script to the head section as instructed, however the script throws an error when loading:

In Safari 16.5:
Screenshot 2023-06-01 at 11 55 17

In Firefox 113.0.2:
Screenshot 2023-06-01 at 11 59 16

...
 <script src="https://unpkg.com/@telemetrydeck/sdk/dist/telemetrydeck.min.js" defer></script>

The error occurs before calling any of the setup functions (like adding app key and user identifier).

Could you help me spot what I'm doing wrong?

Update README

  • The readme links to docs.telemetrydeck.com but it should link to telemetrydeck.com/docs
  • double hasing ๐Ÿฐ

Refactor into poly form cross-compatible module

We're splitting up the JavaScript SDK into two parts:

  1. This repo will contain a module that can be imported into node based projects and will also be used by an upcoming React SDK
  2. A new repo, "WebSDK" will contain code that can be run directly from a website such as Wordpress

Refactor this repository into a package that is used in proper node projects.

Undefined behavior when loading TD and then pushing multiple items at once

STR

  • When you include the SDK
  • wait for it to load
  • and then call td.push(...) with multiple entries

only the first element of the pushed elements is called.

Example that will not send a signal:

// assume window.td is already loaded at this point
window.td.push(["app", "LOLOLOL"], ["user", "anon"], ["signal"]);

Send payload as dict

Since the Ingest v2 API now supports payloads as dictionaries, we should no longer convert the payload into a colon-separated array.

Error when running in non-secure mode

I am trying to integrate TelementryDeck into a simple static website (statushook.cool) and I get an error in the console of my developer tools and TelemetryDeck does not log any signals.

In Chrome the message is:
TypeError: Cannot read properties of undefined (reading 'digest')

In Safari 15.5 the message is:
TypeError: undefined is not an object (evaluating 'crypto.subtle.digest')

Is there a way t fix this? Feel free to poke into the website code to see how it's set up in the <head>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.