Skip to content

Authentication Issues

Invalid Credentials → BigshipAuthError (HTTP 401)

Section titled “Invalid Credentials → BigshipAuthError (HTTP 401)”

If you receive a BigshipAuthError with HTTP status 401, your userName, password, or accessKey is incorrect.

import { BigshipClient, BigshipAuthError } from "@agamya/bigship-sdk";
try {
const client = new BigshipClient({
userName: process.env.BIGSHIP_USERNAME,
password: process.env.BIGSHIP_PASSWORD,
accessKey: process.env.BIGSHIP_ACCESS_KEY,
});
} catch (err) {
if (err instanceof BigshipAuthError) {
console.error("Authentication failed:", err.message);
}
}
  • Verify your credentials in the Bigship dashboard.
  • Ensure no trailing whitespace in environment variables.

The SDK auto-refreshes tokens before expiry. If you still hit auth errors under load, adjust tokenTtlMs:

const client = new BigshipClient({
userName: process.env.BIGSHIP_USERNAME,
password: process.env.BIGSHIP_PASSWORD,
accessKey: process.env.BIGSHIP_ACCESS_KEY,
tokenTtlMs: 50 * 60 * 1000, // 50 minutes (default is 55 minutes)
});

Setting tokenTtlMs lower than the server-side expiry forces more frequent refreshes.

Ensure the baseURL matches your Bigship account region:

const client = new BigshipClient({
userName: process.env.BIGSHIP_USERNAME,
password: process.env.BIGSHIP_PASSWORD,
accessKey: process.env.BIGSHIP_ACCESS_KEY,
baseURL: "https://api.bigship.direct", // default base URL
});

Check your account settings for the correct regional endpoint.

Firewall / Network Issues → BigshipNetworkError

Section titled “Firewall / Network Issues → BigshipNetworkError”

If requests fail before reaching the server, you may receive a BigshipNetworkError:

import { BigshipNetworkError } from "@agamya/bigship-sdk";
try {
await client.createOrder(orderPayload);
} catch (err) {
if (err instanceof BigshipNetworkError) {
console.error("Network error:", err.message);
// err.statusCode will be -1 for connection-level failures
}
}
  • Whitelist *.bigship.direct domains in your firewall.
  • If behind a corporate proxy, see Network Errors.