OnlinePlayground
Ditto's OnlinePlayground API provides a easy-to-use authentication mode that allows you to sync with peers that share the same app ID.
With the playground authentication mode, you can explore platform features and functionality without the hastle of setting up your own authentication mechanism.
Before you can sync offline, you must first connect to the internet to retrieve your playground certificate. (See Playground Access Credentials)
Unless you have a specialized use case, such as a government app, you must connect to the internet at least once before you can sync offline with other peers.
For more information, see Authentication.
The playground certificate is an X.509-formatted certificate generated automatically by the Big Peer when a network connection is available. Once you've obtained your playground certificate from the Big Peer, you can go offline and sync with unrestricted platform access for a maximum of one week — reading and writing to all collections and establishing connections with all peers sharing the same app ID.
After one week, however, your playground certificate expires and you lose access to the platform, requiring you to reconnect to the internet so the Big Peer can automatically generate a new playground certificate.
To explore Ditto without the commitment, authenticate using the playground identity:
From the portal, create an app and get your access credentials. For instructions, see Onboarding:
Your access credentials consists of an app ID and playground token:
- The app ID is a unique identifier that Ditto uses to recognize your app:
- The Big Peer uses the app ID to identify your app before issuing your playground certificate.
- Peers that share the same app ID will automatically form a mesh network, using any transports available on their respective devices. For more information, see Platform Manual > Transports.
- The playground token is a JSON web token (JWT) that the Big Peer uses to verify your digital identity before generating your playground certificate for offline peer-to-peer sync.
In the top-most scope of the codebase of your app, set up and initialize Ditto and and configure your app to use the online playground for testing.