UNPKG

@azure/ai-text-analytics

Version:
22 lines 798 B
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. const API_KEY_HEADER_NAME = "Ocp-Apim-Subscription-Key"; /** * The programmatic identifier of the textAnalyticsAzureKeyCredentialPolicy. */ export const textAnalyticsAzureKeyCredentialPolicyName = "textAnalyticsAzureKeyCredentialPolicy"; /** * Create an HTTP pipeline policy to authenticate a request * using an `AzureKeyCredential` for Text Analytics * @internal */ export function textAnalyticsAzureKeyCredentialPolicy(credential) { return { name: textAnalyticsAzureKeyCredentialPolicyName, sendRequest(request, next) { request.headers.set(API_KEY_HEADER_NAME, credential.key); return next(request); } }; } //# sourceMappingURL=azureKeyCredentialPolicy.js.map