question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow the client to be used in a nodejs instance

See original GitHub issue

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
gutnarcommented, Feb 3, 2022

I managed to use the client in NodeJS by providing some global variables from wrtc and node-fetch packages.

// Polyfills
import wrtc from "wrtc";
import fetch from "node-fetch";

global.RTCPeerConnection = wrtc.RTCPeerConnection;
global.RTCSessionDescription = wrtc.RTCSessionDescription;
// @ts-ignore
global.fetch = fetch;

// Client can now be used
import geckos from "@geckos.io/client";
0reactions
emansomcommented, Sep 2, 2022

It would add two extra (rather large) dependencies to the package.

Which a tree shake algorithm, which most bundlers implement, would filter out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create an HTTP Client with Core HTTP in Node.js
This tutorial requires that you have Node.js installed. Once installed, you will be able to access the https module that's used throughout the ......
Read more >
how to use node.js module system on the clientside
SubStack on github has a module called node-browserify. It will compress and bundle your modules and deliver it as a single js file, ......
Read more >
Introduction to the Node.js Client API - Documentation
The Node.js Client API enables you to create Node.js applications that can read, write, and query documents and semantic data in a MarkLogic...
Read more >
EC2 Instance Connect Client - AWS SDK for JavaScript v3
Amazon EC2 Instance Connect enables system administrators to publish one-time use SSH public keys to EC2, providing users a simple and secure way...
Read more >
5 ways to make HTTP requests in Node.js
The example we will use. We will make an example GET request with all the HTTP client options by calling data from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found