-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathapp-services.txt
91 lines (70 loc) · 3.34 KB
/
app-services.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
90
91
.. meta::
:robots: noindex, nosnippet
.. _kotlin-app-services:
.. _kotlin-mongodb-realm-cloud:
.. _kotlin-application-services:
===============================
Atlas App Services - Kotlin SDK
===============================
.. toctree::
:titlesonly:
Connect to App Services </sdk/kotlin/app-services/connect-to-app-services-backend>
Call an Atlas Function </sdk/kotlin/app-services/call-function>
Handle App Errors </sdk/kotlin/app-services/handle-app-errors>
.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
Realm SDKs let you connect your client apps to the Atlas App Services backend.
The SDKs provide the functionality needed to authenticate users with any of
the built-in :ref:`authentication providers <authentication-providers>`
and call server-side :ref:`Functions <functions>`. You can also use an
App Services App to :ref:`sync data between devices <sync>`.
The App Client
--------------
To connect to your App Services backend, start with an
`App <{+kotlin-sync-prefix+}io.realm.kotlin.mongodb/-app/index.html>`__ object.
This object provides all other functionality related to
the backend. Initialize an App with the App ID, which you can
:ref:`find in the App Services UI <find-your-app-id>`.
To learn how to initialize the App client, refer to
:ref:`Connect to App Services <kotlin-connect-to-backend>`.
.. button:: Create an App Services Account
:uri: https://www.mongodb.com/realm/register?tck=docs_CTA_realm_kotlin
Authentication & User Management
--------------------------------
One of the most challenging aspects of client development is implementing a
robust and secure authentication system. With the Realm SDKs,
however, you can use any of the Realm authentication providers with
minimal backend setup and client-side code. With the authentication APIs,
you can implement the following functionality:
- Create new user accounts
- User log in and log out
- Multiple users logged on at the same time on the same device
- Link user accounts from different providers
- Store custom data for a particular user
To learn how to set up authentication in your app, refer to
:ref:`Authenticate Users <kotlin-authenticate>`.
Device Sync
-----------
Device Sync adds data synchronization between an App Services backend and
client devices on top of all of the functionality of Realm.
When you use Realm with Sync, realms exist on device,
similar to using Realm without Sync. However, changes to
the data stored in those realms synchronize between all client
devices through a backend App Services instance. That backend also stores
realm data in a cloud-based Atlas cluster running MongoDB.
To get started with Sync, refer to :ref:`Device Sync <kotlin-realm-sync>`.
Call Atlas Functions
--------------------
:ref:`Atlas Functions <functions>` let you define and execute server-side
logic. You can call these Functions from your client applications
via the Realm SDKs. These server-side functions can run in the context
of the authenticated user, and thus honor the rules, roles, and permissions that
you have assigned to your data in Atlas.
Using Functions provides a secure way for multiple client
applications to share complex functionality without having to reproduce that
logic client-side.
To learn how to call an Atlas Function from your client app,
refer to :ref:`Call a Function <kotlin-call-function>`.