Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-zijdemans-vipps committed Oct 12, 2024
1 parent a184051 commit b2b5e1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/base_client_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ export const createHeaders = (
return filterHeaders(combinedHeaders, omitHeaders);
};

/**
* Generates a User-Agent string for the SDK.
*
* @param {string} version - The version of the SDK.
* @param {string | undefined} moduleURL - The URL of the module. If the SDK is loaded using require, this will be undefined.
* @returns {string} The generated User-Agent string.
*/
export const getUserAgent = (version: string, moduleURL: string | undefined): string => {
// If the sdk is loaded using require, import.meta.url will be undefined
if (!moduleURL) {
Expand Down
2 changes: 1 addition & 1 deletion src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const Client = (options: ClientConfig): SDKClient => {
const version = "1.0.0";

// Create the base client
const client = baseClient({ ...options, version }); // Add version information to the client configuration
const client = baseClient({ ...options, version });

// Proxify the base client with the API request factories
return proxifyClient(client);
Expand Down

0 comments on commit b2b5e1e

Please sign in to comment.