siarashield_workspace 0.0.8 → 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 +17 -6
  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) {
@@ -58,14 +64,19 @@ Add `CaptchaSubmit` class in your submit button:
58
64
 
59
65
  ## jQuery loading behavior
60
66
 
61
- Loads:
62
- - jQuery: `https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js`
63
-
64
- If user already has another jQuery then no need to import this one, it works properly.
67
+ The package checks if jQuery already exists in the user project (`window.jQuery`, `window.$`, or existing jquery script tag).
68
+ If jQuery is already available, package will not load it again.
69
+ If jQuery is missing, package will load:
70
+ - `https://embedcdn.mycybersiara.com/capcha-temple/js/jquery.min.js`
65
71
 
66
72
  Also loads:
67
73
  - `https://embedcdn.mycybersiara.com/CaptchaFormate/CaptchaResources.js`
68
74
 
75
+ ## CSP (strict policy) support
76
+
77
+ Keep CSP allowlist for required hosts:
78
+ - `https://embedcdn.mycybersiara.com`
79
+
69
80
  ## Build and pack
70
81
 
71
82
  From workspace root:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siarashield_workspace",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Angular wrapper for CyberSiara SiaraShield captcha embed.",
5
5
  "keywords": [
6
6
  "cybersiara",