1.7.0 • Published 4 months ago

d2l-fetch-auth v1.7.0

Weekly downloads
611
License
Apache-2.0
Repository
-
Last release
4 months ago

d2l-fetch-auth

NPM version

Provides a middleware function for wrapping a window.Request object with d2l authentication for use with d2l-fetch.

Installation

Install from NPM:

npm install d2l-fetch-auth

Usage

Reference the script in your html after your reference to d2l-fetch (see here for details on d2l-fetch):

<script type="module">
import auth from 'd2l-fetch-auth/d2l-fetch-auth.js';
</script>

Alternatively, if you are making requests from within the context of an iFramed Free Range Application (iFRA), reference the framed script:

<script type="module">
import auth from 'd2l-fetch-auth/d2l-fetch-auth-framed.js';
</script>

This will import the auth middleware function.

Auth

Install the auth middleware to d2lfetch via the use function and then start making your requests.

d2lfetch.use({name: 'auth', fn: auth});

const response = await d2lfetch.fetch(
	new Request('http://example.com/api/entity/1')
);

Versioning and Releasing

This repo is configured to use semantic-release. Commits prefixed with fix: and feat: will trigger patch and minor releases when merged to main.

To learn how to create major releases and release from maintenance branches, refer to the semantic-release GitHub Action documentation.

1.7.0

4 months ago

1.5.3

2 years ago

1.6.0

2 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

0.14.0

5 years ago