We recommend developing SQRL functions using TypeScript. Getting set up with TypeScript is out of scope for this tutorial, but as a prerequisite you should be comfortable running TypeScript code on the command line.
First install the sqrl
package. We’ll also install the sqrl-cli
package which makes it easy to create a command line application to test with.
1 | npm install --save sqrl sqrl-cli |
Once the packages are installed you can create a basic registration function
1 | import {Instance, Execution, AT } from "sqrl" |
Finally sqrl-cli
exposes a run method that makes testing this out far easier:
1 | import { run } from "sqrl-cli"; |
Now if you run your TypeScript file, you should get the standard SQRL command line interface with your function included. We use ts-node so that you don’t have to recompile each time.
1 | $ ts-node src/cli.ts repl |