UNPKG

@azure/ai-language-text

Version:

An isomorphic client library for the text analysis features in the Azure Cognitive Language Service.

22 lines 792 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. */ 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