Gathering detailed insights and metrics for @factset/sdk-utils
Gathering detailed insights and metrics for @factset/sdk-utils
Gathering detailed insights and metrics for @factset/sdk-utils
Gathering detailed insights and metrics for @factset/sdk-utils
Utilities that support FactSet's SDK in TypeScript
npm install @factset/sdk-utils
Typescript
Module System
Min. Node Version
53.4
Supply Chain
100
Quality
80.8
Maintenance
100
Vulnerability
100
License
TypeScript (99.11%)
JavaScript (0.89%)
Total Downloads
28,538
Last Day
108
Last Week
1,882
Last Month
8,989
Last Year
19,115
1 Stars
254 Commits
1 Forks
2 Watching
8 Branches
6 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.1
Package Id
@factset/sdk-utils@2.0.1
Unpacked Size
37.14 kB
Size
10.87 kB
File Count
24
Publised On
04 Jun 2024
Cumulative downloads
Total Downloads
Last day
-79.3%
108
Compared to previous day
Last week
-24.4%
1,882
Compared to previous week
Last month
44.7%
8,989
Compared to previous month
Last year
279.8%
19,115
Compared to previous year
This repository contains a collection of utilities that supports FactSet's SDK in TypeScript and JavaScript, and facilitate usage of FactSet APIs.
1npm install @factset/sdk-utils
1yarn add @factset/sdk-utils
This library contains multiple modules, sample usage of each module is below.
First, you need to create the OAuth 2.0 client configuration that will be used to authenticate against FactSet's APIs:
1import { ConfidentialClient } from '@factset/sdk-utils'; 2import axios from 'axios'; 3 4async function exampleRequest() { 5 // The ConfidentialClient instance should be reused in production environments. 6 const confidentialClient = new ConfidentialClient('/path/to/config.json'); 7 const accessToken = await confidentialClient.getAccessToken(); 8 9 const response = await axios.get('https://api.factset.com/analytics/lookups/v3/currencies', { 10 headers: { 11 Authorization: `Bearer ${accessToken}`, 12 }, 13 }); 14 15 console.log(response.data); 16} 17 18exampleRequest();
You can pass proxy settings to the ConfidentialClient if necessary. The proxy URL can be passed as an object with the proxyUrl property:
1const confidentialClient = new ConfidentialClient('/path/to/config.json', { proxyUrl: 'http://username:password@proxy.example.com:8080' });
Information about the various utility modules contained in this library can be found below.
The authentication module provides helper classes that facilitate OAuth 2.0 authentication and authorization with FactSet's APIs. Currently, the module has support for the client credentials flow.
Each helper class in the module has the following features:
Configuration
instance that contains information about the OAuth 2.0 client, including the client ID and private key.Classes in the authentication module require OAuth 2.0 client configuration information to be passed to the constructor in the ConfidentialClient
through a JSON-formatted file or a ConfidentialClientConfiguration
object. Below is an example of a JSON-formatted file:
1{ 2 "name": "Application name registered with FactSet's Developer Portal", 3 "clientId": "OAuth 2.0 Client ID registered with FactSet's Developer Portal", 4 "clientAuthType": "Confidential", 5 "owners": ["USERNAME-SERIAL"], 6 "jwk": { 7 "kty": "RSA", 8 "use": "sig", 9 "alg": "RS256", 10 "kid": "Key ID", 11 "d": "ECC Private Key", 12 "n": "Modulus", 13 "e": "Exponent", 14 "p": "First Prime Factor", 15 "q": "Second Prime Factor", 16 "dp": "First Factor CRT Exponent", 17 "dq": "Second Factor CRT Exponent", 18 "qi": "First CRT Coefficient" 19 } 20}
The other option is to pass in the ConfidentialClientConfiguration
instance which is initialised as shown below:
1const confidentialClientConfiguration = { 2 name: "Application name registered with FactSet's Developer Portal", 3 clientId: "OAuth 2.0 Client ID registered with FactSet's Developer Portal", 4 clientAuthType: "Confidential", 5 owners: ["USERNAME-SERIAL"], 6 jwk: { 7 kty: "RSA", 8 use: "sig", 9 alg: "RS256", 10 kid: "Key ID", 11 d: "ECC Private Key", 12 n: "Modulus", 13 e: "Exponent", 14 p: "First Prime Factor", 15 q: "Second Prime Factor", 16 dp: "First Factor CRT Exponent", 17 dq: "Second Factor CRT Exponent", 18 qi: "First CRT Coefficient" 19 } 20};
If you're just starting out, you can visit FactSet's Developer Portal to create a new application and download a configuration file in this format.
If you're creating and managing your signing key pair yourself, see the required JWK parameters for public-private key pairs.
Please refer to the contributing guide.
Copyright 2024 FactSet Research Systems Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
No vulnerabilities found.
No security vulnerabilities found.