summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPawel Zelawski <pawel.zelawski@outlook.com>2025-04-09 20:18:15 +0200
committerPawel Zelawski <pawel.zelawski@outlook.com>2025-04-09 20:18:15 +0200
commita45bcd5f84b2e7be982e170aa31f64afac61a337 (patch)
tree7050422e138b7ffdc75222639a9038ed4a457dfd /README.md
parent14d86ef2043828ad624f2bded91de838c3a13fcd (diff)
docs: Add README, usage examples, and example runner instructions
- Create comprehensive README.md including: - Features, Installation (from GitHub), Usage examples (URI generation, callback verification), API Reference, Dependency status note, Testing instructions. - Review and confirm adequacy of TSDoc comments in source files. - Update README intro sentence and add explicit notes on required URL format. - Create `examples/` directory with runnable scripts: - `examples/generate-uri.ts` - `examples/verify-callback-example.ts` - Update signature verification helper (`_internalVerifySignature`) to use `createRequire` for CJS dependency loading in ESM context (required for examples). - Add "Running Examples" section to README with the correct `node --loader ts-node/esm` command.
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index 155aa09..6fce048 100644
--- a/README.md
+++ b/README.md
@@ -131,6 +131,16 @@ app.post('/api/digiid/callback', async (req, res) => {
(Refer to `src/types.ts` for detailed interface definitions)
+## Running Examples
+
+Examples are available in the `examples/` directory. You can run them using `ts-node` via the Node.js loader:
+
+```bash
+# Ensure ts-node is installed (npm install -D ts-node)
+node --loader ts-node/esm examples/generate-uri.ts
+node --loader ts-node/esm examples/verify-callback-example.ts
+```
+
## Dependencies
This library currently uses a specific commit from a fork of `bitcore-message` (`digicontributer/bitcore-message`) for signature verification, matching the original `digiid-js` library. This is an older dependency.