siarashield_workspace 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +8 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -10,13 +10,14 @@ npm i siarashield_workspace
10
10
 
11
11
  ## Setup steps
12
12
 
13
- 1. Get your public & private key from `mycybersiara.com`
13
+ 1. Get your public & private key from <a href="https://mycybersiara.com" target="_blank" rel="noopener noreferrer">mycybersiara.com</a> (register if needed)
14
14
  - Note: Use public key `TEST-CYBERSIARA` for staging/development.
15
15
 
16
16
  2. Set key config in project (proper place)
17
17
  - Frontend public key file:
18
18
  - `src/environments/environment.ts` (development)
19
19
  - `src/environments/environment.prod.ts` (production)
20
+ - If your project already uses `.env`, that is also okay. Map `.env` value to the same public key in frontend config.
20
21
  - Backend private key file:
21
22
  - backend server `.env` only (Node/.NET/Java API), never in Angular code.
22
23
 
@@ -40,7 +41,12 @@ import { initSiaraShield, checkSiaraShieldCaptchaAsync } from 'siarashield_works
40
41
  5. Initialize captcha and validate on submit:
41
42
 
42
43
  ```ts
43
- await initSiaraShield({ publicKey: 'TEST-CYBERSIARA', loadJQuery: true });
44
+ import { environment } from '../environments/environment';
45
+
46
+ await initSiaraShield({
47
+ publicKey: environment.siaraShieldPublicKey, // or your .env mapped value
48
+ loadJQuery: true,
49
+ });
44
50
 
45
51
  const result = await checkSiaraShieldCaptchaAsync();
46
52
  if (result.ok) {
@@ -66,11 +72,6 @@ If jQuery is missing, package will load:
66
72
  Also loads:
67
73
  - `https://embedcdn.mycybersiara.com/CaptchaFormate/CaptchaResources.js`
68
74
 
69
- ## Submit only when captcha is valid
70
-
71
- Put submit logic inside `if (result.ok)`.
72
- For best UX, use async check (`checkSiaraShieldCaptchaAsync`) to avoid first-click timing delay.
73
-
74
75
  ## CSP (strict policy) support
75
76
 
76
77
  Keep CSP allowlist for required hosts:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siarashield_workspace",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Angular wrapper for CyberSiara SiaraShield captcha embed.",
5
5
  "keywords": [
6
6
  "cybersiara",