react-native-eks-auth
A package for authenticating to AWS EKS clusters using IAM authentication from within a React Native environment without access to Node.js core modules.
Install
$ npm install --save react-native-eks-auth
Syntax
getBearerToken(clusterName, credentials)
This generates a bearer token which can then be used in the Authorization
header of Kubernetes RESTful API requests to EKS clusters.
Example Usage
;; const apiFetch = async { const credentials = accessKeyId: '<your-access-key-id>' secretAccessKey: '<your-secret-access-key>' const token = ; const authHeader = Authorization: `Bearer ` ; const res = await RNFetchBlob ; return res;}
Your AWS credentials (which can be found in your AWS console) are specified as the second argument in an object:
;