diff --git a/doc/api.md b/doc/api.md
index 6eb5ce6..c13c2b2 100644
--- a/doc/api.md
+++ b/doc/api.md
@@ -21,7 +21,7 @@
invalidateCache() ⇒ void
Invalidates the token cache
-generateAccessToken(params) ⇒ Promise.<object>
+generateAccessToken(params, [imsEnv]) ⇒ Promise.<object>
Generates an access token for authentication (with caching)
@@ -73,7 +73,7 @@ Invalidates the token cache
**Kind**: global function
-## generateAccessToken(params) ⇒ Promise.<object>
+## generateAccessToken(params, [imsEnv]) ⇒ Promise.<object>
Generates an access token for authentication (with caching)
**Kind**: global function
@@ -90,5 +90,5 @@ Generates an access token for authentication (with caching)
| params.clientSecret | string | | The client secret |
| params.orgId | string | | The organization ID |
| [params.scopes] | Array.<string> | [] | Array of scopes to request |
-| [params.environment] | string | "'prod'" | The IMS environment ('prod' or 'stage') |
+| [imsEnv] | string | | The IMS environment ('prod' or 'stage'); when omitted or falsy, uses stage if __OW_NAMESPACE starts with 'development-', else prod |
diff --git a/package.json b/package.json
index 6276074..af3a96c 100644
--- a/package.json
+++ b/package.json
@@ -2,17 +2,8 @@
"name": "@adobe/aio-lib-core-auth",
"version": "1.0.0",
"description": "Adobe I/O Core Authentication Library",
- "type": "module",
"main": "src/index.js",
"types": "types.d.ts",
- "exports": {
- ".": {
- "import": "./src/index.js",
- "types": "./types.d.ts",
- "require": "./src/index.js",
- "default": "./src/index.js"
- }
- },
"scripts": {
"test": "vitest run --coverage",
"lint": "eslint src test",
diff --git a/src/errors.js b/src/errors.js
index f7b6584..a2e81b5 100644
--- a/src/errors.js
+++ b/src/errors.js
@@ -9,7 +9,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
-import { AioCoreSDKErrorWrapper } from '@adobe/aio-lib-core-errors'
+const { AioCoreSDKErrorWrapper } = require('@adobe/aio-lib-core-errors')
const { ErrorWrapper, createUpdater } = AioCoreSDKErrorWrapper
const codes = {}
@@ -44,4 +44,4 @@ E('BAD_CREDENTIALS_FORMAT', 'Credentials must be either an object or a stringifi
E('BAD_SCOPES_FORMAT', 'Scopes must be an array')
E('GENERIC_ERROR', 'An unexpected error occurred: %s')
-export { codes, messages }
+module.exports = { codes, messages }
diff --git a/src/ims.js b/src/ims.js
index c825945..e739e0a 100644
--- a/src/ims.js
+++ b/src/ims.js
@@ -9,7 +9,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
-import { codes } from './errors.js'
+const { codes } = require('./errors.js')
/**
* IMS Base URLs
@@ -36,7 +36,7 @@ function getImsUrl (env) {
* @returns {object} Validated credentials object
* @throws {Error} If any required parameters are missing
*/
-export function getAndValidateCredentials (params) {
+function getAndValidateCredentials (params) {
if (!(typeof params === 'object' && params !== null && !Array.isArray(params))) {
throw new codes.BAD_CREDENTIALS_FORMAT({
sdkDetails: { paramsType: typeof params }
@@ -89,7 +89,7 @@ export function getAndValidateCredentials (params) {
* @returns {Promise