Quickstart
Two programs: one to onboard @alice (run once) and one to use the SDK (run any time after).
See Prerequisites before you start.
1. Create the project
dart create quickstart
cd quickstart
dart pub add at_client at_auth at_commonsYour pubspec.yaml file should look something like this:
name: quickstart
description: A sample command-line application.
version: 1.0.0
environment:
sdk: ^3.12.0
dependencies:
at_auth: ^3.3.0
at_client: ^3.14.0
at_commons: ^5.15.0
path: ^1.9.0
dev_dependencies:
lints: ^6.0.0
test: ^1.25.62. Onboard (run once)
bin/onboard.dart - activates @alice by exchanging a one-time CRAM secret for permanent keys. This should only be performed once; after that, the .atHeys file exists, and this program cannot be run again. This is equivalent to using the at_activate tool to do the initial onboarding of your Atsign.
Write this content to
bin/onboard.dart
Change the
myAtSignstring to the Atsign you own
Run the program:
Sample output
This will write an .atKeys file to ~/.atsign/keys/ and onboard (also known as activate) your Atsign.
Ensure you backup your keys! Read our section on atKeys to learn what this file really is.
If you want to reset your Atsign and run this step again, see our section on Resetting your Atsign.
3. Write the quickstart program
bin/quickstart.dart — authenticates with the .atKeys file from step 2, writes an encrypted record, shares it with @bob, and reads it back. You can run this program as many times as you like.
Copy and paste this code into
bin/quickstart.dart
Replace
@alicewith your Atsign.
Run the program
Sample output:
4. Clean up
bin/cleanup.dart — a Dart program that will clean up the data left by Step 3 ( 3. Write the quickstart program ).
Copy and paste this code into
bin/cleanup.dart
Change the
myAtSignto the Atsign you activated last step.
Run the program
Sample output:
Last updated