emissions-api-sdk 1.0.0 → 1.0.2
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.
- package/README.md +33 -2
- package/dist/Constants.js +23 -1
- package/dist/api/Calculation.js +78 -15
- package/dist/api/Factor.js +99 -18
- package/dist/api/FactorSets.js +1 -1
- package/dist/api/Fugitive.js +76 -13
- package/dist/api/Location.js +76 -15
- package/dist/api/Mobile.js +65 -1
- package/dist/api/Stationary.js +78 -15
- package/dist/api/TransportationAndDistribution.js +77 -14
- package/dist/coverage/clover.xml +191 -81
- package/dist/coverage/coverage-final.json +11 -11
- package/dist/coverage/lcov-report/index.html +16 -16
- package/dist/coverage/lcov-report/src/Client.ts.html +23 -23
- package/dist/coverage/lcov-report/src/Constants.ts.html +82 -4
- package/dist/coverage/lcov-report/src/api/Calculation.ts.html +245 -26
- package/dist/coverage/lcov-report/src/api/Factor.ts.html +313 -34
- package/dist/coverage/lcov-report/src/api/FactorSets.ts.html +8 -5
- package/dist/coverage/lcov-report/src/api/Fugitive.ts.html +246 -24
- package/dist/coverage/lcov-report/src/api/Location.ts.html +245 -26
- package/dist/coverage/lcov-report/src/api/Mobile.ts.html +240 -12
- package/dist/coverage/lcov-report/src/api/Stationary.ts.html +248 -26
- package/dist/coverage/lcov-report/src/api/TransportationAndDistribution.ts.html +250 -25
- package/dist/coverage/lcov-report/src/api/index.html +25 -25
- package/dist/coverage/lcov-report/src/index.html +7 -7
- package/dist/coverage/lcov-report/src/request.ts.html +1 -1
- package/dist/coverage/lcov-report/src/utils.ts.html +5 -5
- package/dist/coverage/lcov-report/test/index.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/CommonRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/FactorRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/GenericCalculationRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/LocationRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/SearchRequest.ts.html +1 -1
- package/dist/coverage/lcov-report/test/mocks/index.html +1 -1
- package/dist/coverage/lcov-report/test/testUtils.ts.html +1 -1
- package/dist/coverage/lcov.info +287 -133
- package/dist/interfaces/response/AreaResponse.js +2 -0
- package/dist/interfaces/response/EmissionResponse.js +2 -0
- package/dist/interfaces/response/EmissionResponseWithDetails.js +2 -0
- package/dist/interfaces/response/FactorResponse.js +2 -0
- package/dist/interfaces/response/FactorSetResponse.js +2 -0
- package/dist/interfaces/response/SearchResponse.js +2 -0
- package/dist/interfaces/response/TypeResponse.js +2 -0
- package/dist/interfaces/response/UnitResponse.js +2 -0
- package/dist/types/Constants.d.ts +22 -0
- package/dist/types/api/Calculation.d.ts +59 -16
- package/dist/types/api/Factor.d.ts +73 -20
- package/dist/types/api/FactorSets.d.ts +3 -2
- package/dist/types/api/Fugitive.d.ts +57 -14
- package/dist/types/api/Location.d.ts +57 -16
- package/dist/types/api/Mobile.d.ts +46 -2
- package/dist/types/api/Stationary.d.ts +59 -16
- package/dist/types/api/TransportationAndDistribution.d.ts +58 -15
- package/dist/types/index.d.ts +8 -0
- package/dist/types/interfaces/response/AreaResponse.d.ts +20 -0
- package/dist/types/interfaces/response/EmissionResponse.d.ts +31 -0
- package/dist/types/interfaces/response/EmissionResponseWithDetails.d.ts +144 -0
- package/dist/types/interfaces/response/FactorResponse.d.ts +53 -0
- package/dist/types/interfaces/response/FactorSetResponse.d.ts +38 -0
- package/dist/types/interfaces/response/SearchResponse.d.ts +41 -0
- package/dist/types/interfaces/response/TypeResponse.d.ts +7 -0
- package/dist/types/interfaces/response/UnitResponse.d.ts +7 -0
- package/docs/.nojekyll +0 -0
- package/docs/_sources/authentication.rst.txt +164 -0
- package/docs/_sources/client.rst.txt +137 -0
- package/docs/_sources/getting_started.rst.txt +164 -0
- package/docs/_sources/index.rst.txt +30 -0
- package/docs/_sources/reference.rst.txt +129 -0
- package/docs/_sources/sdk.rst.txt +13 -0
- package/docs/_sources/troubleshooting.rst.txt +486 -0
- package/docs/_static/basic.css +914 -0
- package/docs/_static/custom.css +16 -0
- package/docs/_static/debug.css +69 -0
- package/docs/_static/doctools.js +149 -0
- package/docs/_static/documentation_options.js +13 -0
- package/docs/_static/file.png +0 -0
- package/docs/_static/language_data.js +192 -0
- package/docs/_static/minus.png +0 -0
- package/docs/_static/plus.png +0 -0
- package/docs/_static/pygments.css +232 -0
- package/docs/_static/scripts/furo-extensions.js +0 -0
- package/docs/_static/scripts/furo.js +3 -0
- package/docs/_static/scripts/furo.js.LICENSE.txt +7 -0
- package/docs/_static/scripts/furo.js.map +1 -0
- package/docs/_static/searchtools.js +632 -0
- package/docs/_static/skeleton.css +296 -0
- package/docs/_static/sphinx_highlight.js +154 -0
- package/docs/_static/sphinx_js.css +0 -0
- package/docs/_static/styles/furo-extensions.css +2 -0
- package/docs/_static/styles/furo-extensions.css.map +1 -0
- package/docs/_static/styles/furo.css +2 -0
- package/docs/_static/styles/furo.css.map +1 -0
- package/docs/authentication.html +523 -0
- package/docs/client.html +477 -0
- package/docs/genindex.html +492 -0
- package/docs/getting_started.html +491 -0
- package/docs/index.html +357 -0
- package/docs/objects.inv +0 -0
- package/docs/reference.html +1584 -0
- package/docs/sdk.html +334 -0
- package/docs/search.html +297 -0
- package/docs/searchindex.js +1 -0
- package/docs/troubleshooting.html +786 -0
- package/package.json +1 -1
- package/sphinx-build/Makefile +49 -0
- package/sphinx-build/requirements.txt +5 -0
- package/sphinx-build/source/_static/custom.css +16 -0
- package/sphinx-build/source/authentication.rst +164 -0
- package/sphinx-build/source/client.rst +137 -0
- package/sphinx-build/source/conf.py +56 -0
- package/sphinx-build/source/getting_started.rst +164 -0
- package/sphinx-build/source/index.rst +30 -0
- package/sphinx-build/source/reference.rst +129 -0
- package/sphinx-build/source/sdk.rst +13 -0
- package/sphinx-build/source/troubleshooting.rst +486 -0
- package/src/Constants.ts +26 -0
- package/src/api/Calculation.ts +94 -20
- package/src/api/Factor.ts +122 -28
- package/src/api/FactorSets.ts +4 -3
- package/src/api/Fugitive.ts +93 -18
- package/src/api/Location.ts +94 -20
- package/src/api/Mobile.ts +83 -6
- package/src/api/Stationary.ts +95 -20
- package/src/api/TransportationAndDistribution.ts +95 -19
- package/src/index.ts +33 -1
- package/src/interfaces/response/AreaResponse.ts +25 -0
- package/src/interfaces/response/EmissionResponse.ts +44 -0
- package/src/interfaces/response/EmissionResponseWithDetails.ts +183 -0
- package/src/interfaces/response/FactorResponse.ts +78 -0
- package/src/interfaces/response/FactorSetResponse.ts +52 -0
- package/src/interfaces/response/SearchResponse.ts +52 -0
- package/src/interfaces/response/TypeResponse.ts +7 -0
- package/src/interfaces/response/UnitResponse.ts +7 -0
- package/test/apiTest.test.ts +173 -6
- package/dist/api/Factors.js +0 -98
- package/dist/api/FugitiveEmission.js +0 -40
- package/dist/api/GenericCalculation.js +0 -41
- package/dist/api/LocationEmission.js +0 -41
- package/dist/api/MobileEmission.js +0 -41
- package/dist/api/StationaryEmission.js +0 -41
- package/dist/api/TransportationDistributionEmission.js +0 -40
- package/dist/coverage/lcov-report/src/api/Factors.ts.html +0 -403
- package/dist/coverage/lcov-report/src/api/FugitiveEmission.ts.html +0 -214
- package/dist/coverage/lcov-report/src/api/GenericCalculation.ts.html +0 -217
- package/dist/coverage/lcov-report/src/api/LocationEmission.ts.html +0 -214
- package/dist/coverage/lcov-report/src/api/MobileEmission.ts.html +0 -220
- package/dist/coverage/lcov-report/src/api/StationaryEmission.ts.html +0 -220
- package/dist/coverage/lcov-report/src/api/TransportationDistributionEmission.ts.html +0 -211
- package/dist/types/api/Factors.d.ts +0 -68
- package/dist/types/api/FugitiveEmission.d.ts +0 -27
- package/dist/types/api/GenericCalculation.d.ts +0 -28
- package/dist/types/api/LocationEmission.d.ts +0 -28
- package/dist/types/api/MobileEmission.d.ts +0 -28
- package/dist/types/api/StationaryEmission.d.ts +0 -28
- package/dist/types/api/TransportationDistributionEmission.d.ts +0 -27
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="no-js" lang="en" data-content_root="./">
|
|
3
|
+
<head><meta charset="utf-8"/>
|
|
4
|
+
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
5
|
+
<meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Reference" href="reference.html" /><link rel="prev" title="Client" href="client.html" />
|
|
7
|
+
|
|
8
|
+
<!-- Generated with Sphinx 8.1.3 and Furo 2025.07.19 -->
|
|
9
|
+
<title>Authentication - IBM Envizi - Emissions API Node.js SDK documentation</title>
|
|
10
|
+
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=25af2a20" />
|
|
12
|
+
<link rel="stylesheet" type="text/css" href="_static/sphinx_js.css" />
|
|
13
|
+
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
|
|
14
|
+
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=8d04aa46" />
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
body {
|
|
21
|
+
--color-code-background: #f2f2f2;
|
|
22
|
+
--color-code-foreground: #1e1e1e;
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
@media not print {
|
|
26
|
+
body[data-theme="dark"] {
|
|
27
|
+
--color-code-background: #2b2b2b;
|
|
28
|
+
--color-code-foreground: #f8f8f2;
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
@media (prefers-color-scheme: dark) {
|
|
32
|
+
body:not([data-theme="light"]) {
|
|
33
|
+
--color-code-background: #2b2b2b;
|
|
34
|
+
--color-code-foreground: #f8f8f2;
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</style></head>
|
|
40
|
+
<body>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
|
48
|
+
<symbol id="svg-toc" viewBox="0 0 24 24">
|
|
49
|
+
<title>Contents</title>
|
|
50
|
+
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
|
|
51
|
+
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
|
|
52
|
+
</svg>
|
|
53
|
+
</symbol>
|
|
54
|
+
<symbol id="svg-menu" viewBox="0 0 24 24">
|
|
55
|
+
<title>Menu</title>
|
|
56
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
57
|
+
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
|
|
58
|
+
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|
59
|
+
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|
60
|
+
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
61
|
+
</svg>
|
|
62
|
+
</symbol>
|
|
63
|
+
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
|
|
64
|
+
<title>Expand</title>
|
|
65
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
66
|
+
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
|
|
67
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
68
|
+
</svg>
|
|
69
|
+
</symbol>
|
|
70
|
+
<symbol id="svg-sun" viewBox="0 0 24 24">
|
|
71
|
+
<title>Light mode</title>
|
|
72
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
73
|
+
stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
|
|
74
|
+
<circle cx="12" cy="12" r="5"></circle>
|
|
75
|
+
<line x1="12" y1="1" x2="12" y2="3"></line>
|
|
76
|
+
<line x1="12" y1="21" x2="12" y2="23"></line>
|
|
77
|
+
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
|
|
78
|
+
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
|
|
79
|
+
<line x1="1" y1="12" x2="3" y2="12"></line>
|
|
80
|
+
<line x1="21" y1="12" x2="23" y2="12"></line>
|
|
81
|
+
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
|
|
82
|
+
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
|
|
83
|
+
</svg>
|
|
84
|
+
</symbol>
|
|
85
|
+
<symbol id="svg-moon" viewBox="0 0 24 24">
|
|
86
|
+
<title>Dark mode</title>
|
|
87
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
88
|
+
stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
|
|
89
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
90
|
+
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
|
|
91
|
+
</svg>
|
|
92
|
+
</symbol>
|
|
93
|
+
<symbol id="svg-sun-with-moon" viewBox="0 0 24 24">
|
|
94
|
+
<title>Auto light/dark, in light mode</title>
|
|
95
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
96
|
+
stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
|
|
97
|
+
class="icon-custom-derived-from-feather-sun-and-tabler-moon">
|
|
98
|
+
<path style="opacity: 50%" d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"/>
|
|
99
|
+
<line x1="14.5" y1="3.25" x2="14.5" y2="1.25"/>
|
|
100
|
+
<line x1="14.5" y1="15.85" x2="14.5" y2="17.85"/>
|
|
101
|
+
<line x1="10.044" y1="5.094" x2="8.63" y2="3.68"/>
|
|
102
|
+
<line x1="19" y1="14.05" x2="20.414" y2="15.464"/>
|
|
103
|
+
<line x1="8.2" y1="9.55" x2="6.2" y2="9.55"/>
|
|
104
|
+
<line x1="20.8" y1="9.55" x2="22.8" y2="9.55"/>
|
|
105
|
+
<line x1="10.044" y1="14.006" x2="8.63" y2="15.42"/>
|
|
106
|
+
<line x1="19" y1="5.05" x2="20.414" y2="3.636"/>
|
|
107
|
+
<circle cx="14.5" cy="9.55" r="3.6"/>
|
|
108
|
+
</svg>
|
|
109
|
+
</symbol>
|
|
110
|
+
<symbol id="svg-moon-with-sun" viewBox="0 0 24 24">
|
|
111
|
+
<title>Auto light/dark, in dark mode</title>
|
|
112
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
113
|
+
stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
|
|
114
|
+
class="icon-custom-derived-from-feather-sun-and-tabler-moon">
|
|
115
|
+
<path d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"/>
|
|
116
|
+
<line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"/>
|
|
117
|
+
<line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"/>
|
|
118
|
+
<line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"/>
|
|
119
|
+
<line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"/>
|
|
120
|
+
<line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"/>
|
|
121
|
+
<line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"/>
|
|
122
|
+
<line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"/>
|
|
123
|
+
<line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"/>
|
|
124
|
+
<circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"/>
|
|
125
|
+
</svg>
|
|
126
|
+
</symbol>
|
|
127
|
+
<symbol id="svg-pencil" viewBox="0 0 24 24">
|
|
128
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
129
|
+
stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-pencil-code">
|
|
130
|
+
<path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" />
|
|
131
|
+
<path d="M13.5 6.5l4 4" />
|
|
132
|
+
<path d="M20 21l2 -2l-2 -2" />
|
|
133
|
+
<path d="M17 17l-2 2l2 2" />
|
|
134
|
+
</svg>
|
|
135
|
+
</symbol>
|
|
136
|
+
<symbol id="svg-eye" viewBox="0 0 24 24">
|
|
137
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
138
|
+
stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-eye-code">
|
|
139
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
140
|
+
<path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
|
|
141
|
+
<path
|
|
142
|
+
d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008" />
|
|
143
|
+
<path d="M20 21l2 -2l-2 -2" />
|
|
144
|
+
<path d="M17 17l-2 2l2 2" />
|
|
145
|
+
</svg>
|
|
146
|
+
</symbol>
|
|
147
|
+
</svg>
|
|
148
|
+
|
|
149
|
+
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
|
|
150
|
+
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
|
|
151
|
+
<label class="overlay sidebar-overlay" for="__navigation">
|
|
152
|
+
<div class="visually-hidden">Hide navigation sidebar</div>
|
|
153
|
+
</label>
|
|
154
|
+
<label class="overlay toc-overlay" for="__toc">
|
|
155
|
+
<div class="visually-hidden">Hide table of contents sidebar</div>
|
|
156
|
+
</label>
|
|
157
|
+
|
|
158
|
+
<a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
<div class="page">
|
|
163
|
+
<header class="mobile-header">
|
|
164
|
+
<div class="header-left">
|
|
165
|
+
<label class="nav-overlay-icon" for="__navigation">
|
|
166
|
+
<div class="visually-hidden">Toggle site navigation sidebar</div>
|
|
167
|
+
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
|
|
168
|
+
</label>
|
|
169
|
+
</div>
|
|
170
|
+
<div class="header-center">
|
|
171
|
+
<a href="index.html"><div class="brand">IBM Envizi - Emissions API Node.js SDK documentation</div></a>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="header-right">
|
|
174
|
+
<div class="theme-toggle-container theme-toggle-header">
|
|
175
|
+
<button class="theme-toggle">
|
|
176
|
+
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
|
|
177
|
+
<svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
|
|
178
|
+
<svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
|
|
179
|
+
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
|
|
180
|
+
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
|
|
181
|
+
</button>
|
|
182
|
+
</div>
|
|
183
|
+
<label class="toc-overlay-icon toc-header-icon" for="__toc">
|
|
184
|
+
<div class="visually-hidden">Toggle table of contents sidebar</div>
|
|
185
|
+
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
|
|
186
|
+
</label>
|
|
187
|
+
</div>
|
|
188
|
+
</header>
|
|
189
|
+
<aside class="sidebar-drawer">
|
|
190
|
+
<div class="sidebar-container">
|
|
191
|
+
|
|
192
|
+
<div class="sidebar-sticky"><a class="sidebar-brand" href="index.html">
|
|
193
|
+
|
|
194
|
+
<span class="sidebar-brand-text">IBM Envizi - Emissions API Node.js SDK documentation</span>
|
|
195
|
+
|
|
196
|
+
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
|
|
197
|
+
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
|
|
198
|
+
<input type="hidden" name="check_keywords" value="yes">
|
|
199
|
+
<input type="hidden" name="area" value="default">
|
|
200
|
+
</form>
|
|
201
|
+
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
|
|
202
|
+
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
|
203
|
+
<ul class="current">
|
|
204
|
+
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
|
|
205
|
+
<li class="toctree-l1 current has-children"><a class="reference internal" href="sdk.html">SDK</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of SDK</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul class="current">
|
|
206
|
+
<li class="toctree-l2"><a class="reference internal" href="client.html">Client</a></li>
|
|
207
|
+
<li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Authentication</a></li>
|
|
208
|
+
</ul>
|
|
209
|
+
</li>
|
|
210
|
+
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
|
|
211
|
+
<li class="toctree-l1"><a class="reference internal" href="troubleshooting.html">Troubleshooting Guide</a></li>
|
|
212
|
+
</ul>
|
|
213
|
+
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
</div>
|
|
220
|
+
</aside>
|
|
221
|
+
<div class="main">
|
|
222
|
+
<div class="content">
|
|
223
|
+
<div class="article-container">
|
|
224
|
+
<a href="#" class="back-to-top muted-link">
|
|
225
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
226
|
+
<path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
|
|
227
|
+
</svg>
|
|
228
|
+
<span>Back to top</span>
|
|
229
|
+
</a>
|
|
230
|
+
<div class="content-icon-container">
|
|
231
|
+
<div class="view-this-page">
|
|
232
|
+
<a class="muted-link" href="_sources/authentication.rst.txt" title="View this page">
|
|
233
|
+
<svg><use href="#svg-eye"></use></svg>
|
|
234
|
+
<span class="visually-hidden">View this page</span>
|
|
235
|
+
</a>
|
|
236
|
+
</div>
|
|
237
|
+
<div class="theme-toggle-container theme-toggle-content">
|
|
238
|
+
<button class="theme-toggle">
|
|
239
|
+
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
|
|
240
|
+
<svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
|
|
241
|
+
<svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
|
|
242
|
+
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
|
|
243
|
+
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
|
|
244
|
+
</button>
|
|
245
|
+
</div>
|
|
246
|
+
<label class="toc-overlay-icon toc-content-icon" for="__toc">
|
|
247
|
+
<div class="visually-hidden">Toggle table of contents sidebar</div>
|
|
248
|
+
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
|
|
249
|
+
</label>
|
|
250
|
+
</div>
|
|
251
|
+
<article role="main" id="furo-main-content">
|
|
252
|
+
<section id="authentication">
|
|
253
|
+
<h1>Authentication<a class="headerlink" href="#authentication" title="Link to this heading">¶</a></h1>
|
|
254
|
+
<section id="overview">
|
|
255
|
+
<h2>Overview<a class="headerlink" href="#overview" title="Link to this heading">¶</a></h2>
|
|
256
|
+
<p>The IBM Envizi - Emissions API Node.js SDK uses OAuth 2.0 Bearer Tokens for authentication. This page explains the authentication process, options, and security best practices in detail.</p>
|
|
257
|
+
</section>
|
|
258
|
+
<section id="authentication-methods">
|
|
259
|
+
<h2>Authentication Methods<a class="headerlink" href="#authentication-methods" title="Link to this heading">¶</a></h2>
|
|
260
|
+
<p>The SDK provides two authentication methods:</p>
|
|
261
|
+
<section id="api-key-authentication-recommended">
|
|
262
|
+
<h3>API Key Authentication (Recommended)<a class="headerlink" href="#api-key-authentication-recommended" title="Link to this heading">¶</a></h3>
|
|
263
|
+
<p>This method automatically handles token generation and refreshing:</p>
|
|
264
|
+
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="k">import</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">Client</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="kr">from</span><span class="w"> </span><span class="s1">'emissions-api-sdk'</span><span class="p">;</span>
|
|
265
|
+
|
|
266
|
+
<span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
|
|
267
|
+
<span class="w"> </span><span class="nx">apiKey</span><span class="o">:</span><span class="w"> </span><span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ENVIZI_API_KEY</span><span class="p">,</span>
|
|
268
|
+
<span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ENVIZI_CLIENT_ID</span><span class="p">,</span>
|
|
269
|
+
<span class="w"> </span><span class="nx">orgId</span><span class="o">:</span><span class="w"> </span><span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ENVIZI_ORG_ID</span>
|
|
270
|
+
<span class="p">});</span>
|
|
271
|
+
</pre></div>
|
|
272
|
+
</div>
|
|
273
|
+
<dl class="simple">
|
|
274
|
+
<dt><strong>Required parameters:</strong></dt><dd><ul class="simple">
|
|
275
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">apiKey</span></code>: Your API key for authentication</p></li>
|
|
276
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">clientId</span></code>: Your client identifier</p></li>
|
|
277
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">orgId</span></code>: Your organization identifier</p></li>
|
|
278
|
+
</ul>
|
|
279
|
+
</dd>
|
|
280
|
+
</dl>
|
|
281
|
+
<section id="token-retrieval">
|
|
282
|
+
<h4>Token retrieval<a class="headerlink" href="#token-retrieval" title="Link to this heading">¶</a></h4>
|
|
283
|
+
<p>When you call <code class="docutils literal notranslate"><span class="pre">Client.getClient()</span></code> with <code class="docutils literal notranslate"><span class="pre">apiKey</span></code>:</p>
|
|
284
|
+
<ul class="simple">
|
|
285
|
+
<li><p><strong>Method</strong>: <code class="docutils literal notranslate"><span class="pre">GET</span></code> to the token endpoint (default: <code class="docutils literal notranslate"><span class="pre">https://api.ibm.com/saascore/run/authentication-retrieve/api-key</span></code>)</p></li>
|
|
286
|
+
<li><p><strong>Headers</strong>:
|
|
287
|
+
- <code class="docutils literal notranslate"><span class="pre">X-Api-Key:</span> <span class="pre"><apiKey></span></code>
|
|
288
|
+
- <code class="docutils literal notranslate"><span class="pre">X-IBM-Client-Id:</span> <span class="pre">saascore-<clientId></span></code>
|
|
289
|
+
- <code class="docutils literal notranslate"><span class="pre">Accept:</span> <span class="pre">application/json</span></code></p></li>
|
|
290
|
+
<li><p><strong>Query param</strong>: <code class="docutils literal notranslate"><span class="pre">orgId=<orgId></span></code></p></li>
|
|
291
|
+
<li><p><strong>Response</strong>: a bearer token (string) which the SDK trims, caches, and uses for API calls.</p></li>
|
|
292
|
+
</ul>
|
|
293
|
+
</section>
|
|
294
|
+
</section>
|
|
295
|
+
<section id="pre-generated-token-authentication">
|
|
296
|
+
<h3>Pre-generated Token Authentication<a class="headerlink" href="#pre-generated-token-authentication" title="Link to this heading">¶</a></h3>
|
|
297
|
+
<p>For scenarios where token generation is handled externally:</p>
|
|
298
|
+
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="k">import</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">Client</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="kr">from</span><span class="w"> </span><span class="s1">'emissions-api-sdk'</span><span class="p">;</span>
|
|
299
|
+
|
|
300
|
+
<span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
|
|
301
|
+
<span class="w"> </span><span class="nx">token</span><span class="o">:</span><span class="w"> </span><span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">JWT_TOKEN</span><span class="p">,</span>
|
|
302
|
+
<span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ENVIZI_CLIENT_ID</span>
|
|
303
|
+
<span class="p">});</span>
|
|
304
|
+
</pre></div>
|
|
305
|
+
</div>
|
|
306
|
+
<dl class="simple">
|
|
307
|
+
<dt><strong>Required parameters:</strong></dt><dd><ul class="simple">
|
|
308
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">token</span></code>: A pre-generated authentication token</p></li>
|
|
309
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">clientId</span></code>: Your client identifier</p></li>
|
|
310
|
+
</ul>
|
|
311
|
+
</dd>
|
|
312
|
+
</dl>
|
|
313
|
+
<section id="token-lifetime-refresh">
|
|
314
|
+
<h4>Token lifetime & refresh<a class="headerlink" href="#token-lifetime-refresh" title="Link to this heading">¶</a></h4>
|
|
315
|
+
<ul class="simple">
|
|
316
|
+
<li><p>The SDK decodes the JWT’s <code class="docutils literal notranslate"><span class="pre">exp</span></code> and stores it.</p></li>
|
|
317
|
+
<li><p>In user-provided token mode, no refresh occurs; re-initialize with a fresh token when needed.</p></li>
|
|
318
|
+
</ul>
|
|
319
|
+
</section>
|
|
320
|
+
</section>
|
|
321
|
+
</section>
|
|
322
|
+
<section id="authentication-flow">
|
|
323
|
+
<h2>Authentication Flow<a class="headerlink" href="#authentication-flow" title="Link to this heading">¶</a></h2>
|
|
324
|
+
<p>The authentication process follows these steps:</p>
|
|
325
|
+
<ol class="arabic simple">
|
|
326
|
+
<li><dl class="simple">
|
|
327
|
+
<dt><strong>Initialization</strong>:</dt><dd><ul class="simple">
|
|
328
|
+
<li><p>User provides authentication credentials</p></li>
|
|
329
|
+
<li><p>Client validates the credentials format</p></li>
|
|
330
|
+
</ul>
|
|
331
|
+
</dd>
|
|
332
|
+
</dl>
|
|
333
|
+
</li>
|
|
334
|
+
<li><dl class="simple">
|
|
335
|
+
<dt><strong>Token Generation</strong> (API Key method):</dt><dd><ul class="simple">
|
|
336
|
+
<li><p>Client sends API key to authentication service</p></li>
|
|
337
|
+
<li><p>Authentication service validates credentials</p></li>
|
|
338
|
+
<li><p>Authentication service returns a token with expiration time</p></li>
|
|
339
|
+
<li><p>Client stores the token securely</p></li>
|
|
340
|
+
</ul>
|
|
341
|
+
</dd>
|
|
342
|
+
</dl>
|
|
343
|
+
</li>
|
|
344
|
+
<li><dl class="simple">
|
|
345
|
+
<dt><strong>Token Validation</strong>:</dt><dd><ul class="simple">
|
|
346
|
+
<li><p>Before each API request, token validity is checked</p></li>
|
|
347
|
+
<li><p>If valid, the token is included in the request</p></li>
|
|
348
|
+
<li><p>If expired or near expiration, token is refreshed</p></li>
|
|
349
|
+
</ul>
|
|
350
|
+
</dd>
|
|
351
|
+
</dl>
|
|
352
|
+
</li>
|
|
353
|
+
<li><dl class="simple">
|
|
354
|
+
<dt><strong>Token Refreshing</strong>:</dt><dd><ul class="simple">
|
|
355
|
+
<li><p>Client detects when token is approaching expiration</p></li>
|
|
356
|
+
<li><p>Client automatically requests a new token</p></li>
|
|
357
|
+
<li><p>New token replaces the old one for future requests</p></li>
|
|
358
|
+
</ul>
|
|
359
|
+
</dd>
|
|
360
|
+
</dl>
|
|
361
|
+
</li>
|
|
362
|
+
</ol>
|
|
363
|
+
</section>
|
|
364
|
+
<section id="authentication-headers">
|
|
365
|
+
<h2>Authentication Headers<a class="headerlink" href="#authentication-headers" title="Link to this heading">¶</a></h2>
|
|
366
|
+
<p>The SDK automatically includes the necessary headers for authentication:</p>
|
|
367
|
+
<dl class="simple">
|
|
368
|
+
<dt>For token generation:</dt><dd><ul class="simple">
|
|
369
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">X-Api-Key</span></code>: Your API key</p></li>
|
|
370
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">X-IBM-Client-Id</span></code>: saascore-{your-client-id}</p></li>
|
|
371
|
+
</ul>
|
|
372
|
+
</dd>
|
|
373
|
+
<dt>For API requests:</dt><dd><ul class="simple">
|
|
374
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">Authorization</span></code>: Bearer {token}</p></li>
|
|
375
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">X-IBM-Client-Id</span></code>: ghgemissions-{your-client-id}</p></li>
|
|
376
|
+
<li><p><code class="docutils literal notranslate"><span class="pre">X-Client-Source</span></code>: node-sdk</p></li>
|
|
377
|
+
</ul>
|
|
378
|
+
</dd>
|
|
379
|
+
</dl>
|
|
380
|
+
</section>
|
|
381
|
+
<section id="architecture-diagram">
|
|
382
|
+
<h2>Architecture Diagram<a class="headerlink" href="#architecture-diagram" title="Link to this heading">¶</a></h2>
|
|
383
|
+
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">+-----------------+</span> <span class="o">+-------------------------+</span>
|
|
384
|
+
<span class="o">|</span> <span class="n">Your</span> <span class="n">application</span><span class="o">|</span> <span class="o">|</span> <span class="n">Token</span> <span class="n">Service</span> <span class="p">(</span><span class="n">GET</span><span class="p">)</span> <span class="o">|</span>
|
|
385
|
+
<span class="o">|</span> <span class="p">(</span><span class="n">init</span> <span class="n">once</span><span class="p">)</span> <span class="o">|</span> <span class="o">|</span> <span class="n">authUrl</span> <span class="o">/</span> <span class="n">default</span> <span class="n">URL</span> <span class="o">|</span>
|
|
386
|
+
<span class="o">+--------+--------+</span> <span class="o">+-----------+-------------+</span>
|
|
387
|
+
<span class="o">|</span> <span class="o">^</span>
|
|
388
|
+
<span class="o">|</span> <span class="n">getClient</span><span class="p">({</span><span class="n">apiKey</span><span class="p">,</span> <span class="n">clientId</span><span class="p">,</span> <span class="o">|</span> <span class="p">(</span><span class="n">managed</span> <span class="n">mode</span> <span class="n">only</span><span class="p">:</span>
|
|
389
|
+
<span class="o">|</span> <span class="n">orgId</span><span class="p">,</span> <span class="p">[</span><span class="n">authUrl</span><span class="p">],</span> <span class="p">[</span><span class="n">host</span><span class="p">]})</span> <span class="o">|</span> <span class="n">X</span><span class="o">-</span><span class="n">Api</span><span class="o">-</span><span class="n">Key</span><span class="p">,</span> <span class="n">saascore</span><span class="o">-</span><span class="n">Client</span><span class="o">-</span><span class="n">Id</span><span class="p">,</span>
|
|
390
|
+
<span class="n">v</span> <span class="o">|</span> <span class="n">orgId</span> <span class="o">=></span> <span class="n">returns</span> <span class="n">JWT</span><span class="p">)</span>
|
|
391
|
+
<span class="o">+--------+--------------------------------+-------------+</span>
|
|
392
|
+
<span class="o">|</span> <span class="n">Client</span> <span class="p">(</span><span class="n">singleton</span><span class="p">)</span> <span class="o">|</span>
|
|
393
|
+
<span class="o">|</span> <span class="o">-</span> <span class="n">token</span><span class="p">,</span> <span class="n">exp</span><span class="p">,</span> <span class="n">domain</span><span class="p">,</span> <span class="n">clientId</span> <span class="o">|</span>
|
|
394
|
+
<span class="o">|</span> <span class="o">-</span> <span class="n">refresh</span> <span class="n">before</span> <span class="n">expiry</span> <span class="p">(</span><span class="n">managed</span> <span class="n">mode</span><span class="p">)</span> <span class="o">|</span>
|
|
395
|
+
<span class="o">+--------+--------------------------------+-------------+</span>
|
|
396
|
+
<span class="o">|</span> <span class="o">^</span>
|
|
397
|
+
<span class="o">|</span> <span class="n">makeApiRequest</span><span class="p">(</span><span class="o">...</span><span class="p">)</span> <span class="o">|</span>
|
|
398
|
+
<span class="n">v</span> <span class="o">|</span>
|
|
399
|
+
<span class="o">+--------+--------------------------------+-------------+</span>
|
|
400
|
+
<span class="o">|</span> <span class="n">Request</span> <span class="n">layer</span> <span class="p">(</span><span class="n">axios</span><span class="p">)</span> <span class="o">|</span>
|
|
401
|
+
<span class="o">|</span> <span class="n">Adds</span> <span class="n">headers</span><span class="p">:</span> <span class="o">|</span>
|
|
402
|
+
<span class="o">|</span> <span class="o">-</span> <span class="n">Authorization</span><span class="p">:</span> <span class="n">Bearer</span> <span class="o"><</span><span class="n">token</span><span class="o">></span> <span class="o">|</span>
|
|
403
|
+
<span class="o">|</span> <span class="o">-</span> <span class="n">X</span><span class="o">-</span><span class="n">IBM</span><span class="o">-</span><span class="n">Client</span><span class="o">-</span><span class="n">Id</span><span class="p">:</span> <span class="n">ghgemissions</span><span class="o">-<</span><span class="n">clientId</span><span class="o">></span> <span class="o">|</span>
|
|
404
|
+
<span class="o">|</span> <span class="o">-</span> <span class="n">X</span><span class="o">-</span><span class="n">Client</span><span class="o">-</span><span class="n">Source</span><span class="p">:</span> <span class="n">excel</span> <span class="o">|</span> <span class="n">node</span><span class="o">-</span><span class="n">sdk</span> <span class="o">|</span>
|
|
405
|
+
<span class="o">+--------+--------------------------------+-------------+</span>
|
|
406
|
+
<span class="o">|</span>
|
|
407
|
+
<span class="n">v</span>
|
|
408
|
+
<span class="o">+--------+--------------------------------+-------------+</span>
|
|
409
|
+
<span class="o">|</span> <span class="n">Emissions</span> <span class="n">API</span> <span class="p">(</span><span class="n">host</span><span class="o">/</span><span class="n">domain</span><span class="p">)</span> <span class="o">|</span>
|
|
410
|
+
<span class="o">+-------------------------------------------------------+</span>
|
|
411
|
+
</pre></div>
|
|
412
|
+
</div>
|
|
413
|
+
</section>
|
|
414
|
+
<section id="security-best-practices">
|
|
415
|
+
<h2>Security Best Practices<a class="headerlink" href="#security-best-practices" title="Link to this heading">¶</a></h2>
|
|
416
|
+
<ol class="arabic">
|
|
417
|
+
<li><p><strong>Use environment variables</strong> for credentials:</p>
|
|
418
|
+
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="k">await</span><span class="w"> </span><span class="nx">Client</span><span class="p">.</span><span class="nx">getClient</span><span class="p">({</span>
|
|
419
|
+
<span class="w"> </span><span class="nx">apiKey</span><span class="o">:</span><span class="w"> </span><span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ENVIZI_API_KEY</span><span class="p">,</span>
|
|
420
|
+
<span class="w"> </span><span class="nx">clientId</span><span class="o">:</span><span class="w"> </span><span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ENVIZI_CLIENT_ID</span><span class="p">,</span>
|
|
421
|
+
<span class="w"> </span><span class="nx">orgId</span><span class="o">:</span><span class="w"> </span><span class="nx">process</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ENVIZI_ORG_ID</span>
|
|
422
|
+
<span class="p">});</span>
|
|
423
|
+
</pre></div>
|
|
424
|
+
</div>
|
|
425
|
+
</li>
|
|
426
|
+
<li><p><strong>Never hardcode</strong> credentials in your application code</p></li>
|
|
427
|
+
<li><p><strong>Implement proper access controls</strong> for API keys</p></li>
|
|
428
|
+
<li><p><strong>Use secure environment variables</strong> for production deployments</p></li>
|
|
429
|
+
<li><p><strong>Implement least privilege</strong> principles for API access</p></li>
|
|
430
|
+
</ol>
|
|
431
|
+
<p>For more information about the Client that manages authentication, see the <a class="reference internal" href="client.html"><span class="doc">Client</span></a> page.</p>
|
|
432
|
+
</section>
|
|
433
|
+
</section>
|
|
434
|
+
|
|
435
|
+
</article>
|
|
436
|
+
</div>
|
|
437
|
+
<footer>
|
|
438
|
+
|
|
439
|
+
<div class="related-pages">
|
|
440
|
+
<a class="next-page" href="reference.html">
|
|
441
|
+
<div class="page-info">
|
|
442
|
+
<div class="context">
|
|
443
|
+
<span>Next</span>
|
|
444
|
+
</div>
|
|
445
|
+
<div class="title">Reference</div>
|
|
446
|
+
</div>
|
|
447
|
+
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
|
|
448
|
+
</a>
|
|
449
|
+
<a class="prev-page" href="client.html">
|
|
450
|
+
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
|
|
451
|
+
<div class="page-info">
|
|
452
|
+
<div class="context">
|
|
453
|
+
<span>Previous</span>
|
|
454
|
+
</div>
|
|
455
|
+
|
|
456
|
+
<div class="title">Client</div>
|
|
457
|
+
|
|
458
|
+
</div>
|
|
459
|
+
</a>
|
|
460
|
+
</div>
|
|
461
|
+
<div class="bottom-of-page">
|
|
462
|
+
<div class="left-details">
|
|
463
|
+
<div class="copyright">
|
|
464
|
+
Copyright © 2025, IBM Corporation
|
|
465
|
+
</div>
|
|
466
|
+
Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
|
|
467
|
+
|
|
468
|
+
<a href="https://github.com/pradyunsg/furo">Furo</a>
|
|
469
|
+
|
|
470
|
+
</div>
|
|
471
|
+
<div class="right-details">
|
|
472
|
+
|
|
473
|
+
</div>
|
|
474
|
+
</div>
|
|
475
|
+
|
|
476
|
+
</footer>
|
|
477
|
+
</div>
|
|
478
|
+
<aside class="toc-drawer">
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
<div class="toc-sticky toc-scroll">
|
|
482
|
+
<div class="toc-title-container">
|
|
483
|
+
<span class="toc-title">
|
|
484
|
+
On this page
|
|
485
|
+
</span>
|
|
486
|
+
</div>
|
|
487
|
+
<div class="toc-tree-container">
|
|
488
|
+
<div class="toc-tree">
|
|
489
|
+
<ul>
|
|
490
|
+
<li><a class="reference internal" href="#">Authentication</a><ul>
|
|
491
|
+
<li><a class="reference internal" href="#overview">Overview</a></li>
|
|
492
|
+
<li><a class="reference internal" href="#authentication-methods">Authentication Methods</a><ul>
|
|
493
|
+
<li><a class="reference internal" href="#api-key-authentication-recommended">API Key Authentication (Recommended)</a><ul>
|
|
494
|
+
<li><a class="reference internal" href="#token-retrieval">Token retrieval</a></li>
|
|
495
|
+
</ul>
|
|
496
|
+
</li>
|
|
497
|
+
<li><a class="reference internal" href="#pre-generated-token-authentication">Pre-generated Token Authentication</a><ul>
|
|
498
|
+
<li><a class="reference internal" href="#token-lifetime-refresh">Token lifetime & refresh</a></li>
|
|
499
|
+
</ul>
|
|
500
|
+
</li>
|
|
501
|
+
</ul>
|
|
502
|
+
</li>
|
|
503
|
+
<li><a class="reference internal" href="#authentication-flow">Authentication Flow</a></li>
|
|
504
|
+
<li><a class="reference internal" href="#authentication-headers">Authentication Headers</a></li>
|
|
505
|
+
<li><a class="reference internal" href="#architecture-diagram">Architecture Diagram</a></li>
|
|
506
|
+
<li><a class="reference internal" href="#security-best-practices">Security Best Practices</a></li>
|
|
507
|
+
</ul>
|
|
508
|
+
</li>
|
|
509
|
+
</ul>
|
|
510
|
+
|
|
511
|
+
</div>
|
|
512
|
+
</div>
|
|
513
|
+
</div>
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
</aside>
|
|
517
|
+
</div>
|
|
518
|
+
</div><script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
519
|
+
<script src="_static/doctools.js?v=9bcbadda"></script>
|
|
520
|
+
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
521
|
+
<script src="_static/scripts/furo.js?v=46bd48cc"></script>
|
|
522
|
+
</body>
|
|
523
|
+
</html>
|