-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathinstall.txt
89 lines (56 loc) · 1.96 KB
/
install.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.. _web-install:
===================
Install the Web SDK
===================
.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
Overview
--------
This page shows you how to install the Web SDK to use with your application.
Before You Begin
----------------
Before you begin installation, you need to :ref:`create an App Services App <create-a-realm-app>`
for your web app to use.
.. note:: React Native & Node.js SDKs
We also provide SDKs built for React Native and Node.js.
Generally, you should use these when creating apps in these environments.
Alternatively, you can use the Web SDK for React Native or Node.js apps.
Further reading:
- :ref:`React Native SDK <react-native-intro>`
- :ref:`Node.js <node-intro>`
- :ref:`Install Web SDK for Node.js <web-install-node>`
Install the Web SDK
-------------------
.. tip:: Atlas Device SDK and Realm
The JS SDKs use the Realm Core database for device data persistence. When
you install the Web SDK, the package names reflect Realm naming.
.. tabs::
.. tab:: npm
:tabid: npm
.. code-block:: shell
npm install realm-web
.. tab:: yarn
:tabid: yarn
.. code-block:: shell
yarn add realm-web
.. tab:: CDN
:tabid: CDN
Add a ``<script>`` tag to the ``<head>`` of your HTML file to load
the Web SDK as a global variable from a content delivery
network.
Use the most recent version:
.. code-block:: html
<script src="https://unpkg.com/realm-web/dist/bundle.iife.js"></script>
Or import a specific version:
.. code-block:: html
<script src="https://unpkg.com/realm-web@1.7.1/dist/bundle.iife.js"></script>
.. _web-install-node:
Install for Node.js
-------------------
In order to use the Web SDK for Node.js environments, you must
install two additional peer dependencies:
.. code-block:: shell
npm install realm-web node-fetch abort-controller