amplitude / Amplitude-JavaScript

JavaScript SDK for Amplitude

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-Browser / React Native / Node / Universal / Isomorphic Support

blazzy opened this issue · comments

The JavaScript SDK currently assumes its running in a browser environment and depends on all kinds browser APIs related to cookies, localStorage, the presence of a global window object and so on.

Ideally the SDK would support server side instrumentation in an environment like node.js. This would also make server side rendering of isomorphic/universal apps easier to pull of with amplitude instrumentation. And presumably this would enable us to use the JavaScript SDK in React Native apps.

Tying all these feature requests together into this one issue here. It's not actively being worked on just yet, but we definitely want to tackle it.

(PS: We're hiring in case you want to help us take this on. 😉See product engineer)

See also #123.

Is there any fallbacks for now, some quick hack to be able to implement it with server-side react?

Nevermind: used this #110 for now

Very much need this. It's been asked since 2017 (#110), maybe time to tackle this issue?

I suggest an official example with Next.js framework (universal framework), definitely the most used out there.

+1. I'm having the same problem (with Node / NextJS) and looking for the same solution (i.e. server-side JavaScript support).

commented

We totally need server side support, https://github.com/crookedneighbor/amplitude is too much behind

Hello from 2020! Are there plans to make this happen relatively soon?

Just wanna let all of you know that we're not forgetting any of the issues from our customers. This year, we definitely will provide better support for all of our the SDKs.

Is there a workaround to use the js SDK with server-side rendering?

Hey all, could you let me know which platform you wanna have support first for server side SDK?
Python?
Node?
Java?
Please leave your comments here, much appreciated!

@haoliu-amp This issue is about server-side JavaScript, so I would guess everyone's answer is Node.

For us having the SDK usable in Electron's main process would be really useful.

@k4113h First time hearing this, what kind of library dependency it uses?

@k4113h First time hearing this, what kind of library dependency it uses?

I'm not sure I fully understood what you're asking, but in an Electron app you have all the Node.js APIs available. In the Electron renderer process you have also the browser APis available, so this SDK works there, but code running in Electron main process can't use it currently.

We started developing our Node.js SDK. Now it's under BETA. Feel free to try it and request what you want by creating issues.

https://github.com/amplitude/Amplitude-Node

I am also closing this ticket too.

Hello @haoliu-amp. Separate SDK for node.js doesn't solve the issue with server side rendering. It's still necessary.