0.12.2 • Published 20 days ago

@sentclose/sentc v0.12.2

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
20 days ago

Sentc Javascript SDK

from sentclose.

End-to-end encryption as a service.

Sentc is an easy to use end-to-end encryption sdk. It can be used for any kind of data.

Example from CDN

The scripts can be downloaded from any CDN provider.

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Sentc example</title>
</head>
<body>
    <script src="https://cdn.jsdelivr.net/npm/@sentclose/sentc/dist/sentc.min.js"></script>

    <script>
        //init the wasm
        const sentc = window.Sentc.default;

        async function run() {
            //use your public token as the app token.
            // if a user is already logged in, this function will return the logged-in user
            await sentc.init({
                app_token: "5zMb6zs3dEM62n+FxjBilFPp+j9e7YUFA+7pi6Hi"
            });
			
            //now you are ready to go
            //register a user:
            await sentc.register("username", "password");
			
            //log in a user
            const user = await sentc.login("username", "password");
			
            //create a group
            const group_id = await user.createGroup();
			
            //load a group. returned a group obj for every user.
            const group = await user.getGroup(group_id);
			
            //invite a user to a group. use the sentc user id
            await group.invite("user_id_of_the_other_user");
			
            //encrypt a string for the group
            const encrypted_string = await group.encryptString("hello there!");
			
            //now every user in the group can decrypt the string
            const decrypted_string = await group.decryptString(encrypted_string);
			
            console.log(decrypted_string);  //hello there!
        }
		
        run();
    </script>
</body>
</html>
0.12.2

20 days ago

0.12.1

2 months ago

0.11.0

7 months ago

0.12.0

6 months ago

0.11.1

7 months ago

0.10.0

9 months ago

0.9.0

10 months ago

0.7.6

1 year ago

0.7.5

1 year ago

0.8.0

11 months ago

0.7.4

1 year ago

0.7.2

1 year ago

0.6.3

1 year ago

0.7.1

1 year ago

0.6.2

1 year ago

0.6.5

1 year ago

0.7.3

1 year ago

0.6.4

1 year ago

0.7.0

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0-rc.1

1 year ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.6

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago