# Examples


These examples were written with an old version of the SDK, this page is being updated.

# Web: Full example

A demo project is available at https://github.com/seald/sdk-web-chat-demo/ (opens new window).

The project is a simple chat, built with React and Firebase.

The repository contains 2 branches:

  • master which contains the normal chat, without encryption
  • encrypted which encrypts all messages with the Seald SDK and secures identities with the @seald-io/sdk-plugin-ssks-password plugin

You can compare the two, to see how the Seald SDK was added, at https://github.com/seald/sdk-web-chat-demo/compare/encrypted (opens new window)

# React-native : minimal example

A demo project is available at https://github.com/seald/sdk-react-native-demo (opens new window).

The project is a minimal demonstration, containing no user interface, just a button to execute a demonstration function.

This test function will :

  • Instantiate an SDK instance, sdk1, with the SSKS Password plugin, create an identity, and save it.
  • Instantiate a second SDK instance, sdk2, similar to the first, with a second identity.
  • The sdk1 instance creates an encrypted exchange session to share with the sdk2.
  • The sdk1 encrypts a message for the members of the session. sdk2 decrypts the message
  • sdk2 encrypt a response for members of the session. sdk1 decrypts the message
  • Instantiate an SDK instance, sdk3, and retrieve the identity created by sdk1.
  • sdk3 reconnects to the previously created encryption session, and check that it can decrypt the messages.

# Quick example

If you want to just take a quick look, here is a snippet of how to use the Seald SDK :