# return-points **Repository Path**: mirrors_Brightspace/return-points ## Basic Information - **Project Name**: return-points - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # return-points [![NPM version](https://img.shields.io/npm/v/@brightspace-ui/return-points.svg)](https://www.npmjs.org/package/@brightspace-ui/return-points) ## Overview A set of APIs to get/set a URL to "return to" after launching into a workflow that may have multiple entry points. ## Installation Install from NPM: ```shell npm install @brightspace-ui/return-points ``` ## Choosing a Return Point Key To prevent nested or circular workflows from stepping on each other, each return point must have a unique string-based key. This key must be known by both sides: the source page launching the workflow and the destination page which sends the user back to the source. Try to make the key as unique as possible for the situation or object being viewed/operated on. Also try to avoid collisions with other applications. Examples of good keys: * "D2L.LE.Quizzing.Quiz.Edit.502" (editing quiz with ID=502) * "D2L.LE.Content.CreateTopic.6609" (workflow to create a new topic in OU=6609) * "D2L.LP.Profile.View.32346" (viewing profile for user=32346) ## Setting the Return Point Before navigating into the destination workflow, the source page should call into the `set` API using the predetermined key. By default, the current URL will be used as the return point, but an optional URL can also be provided. ```javascript import { setReturnPoint } from '@brightspace-ui/return-points'; setReturnPoint( 'myKey', '/optional/url' ); ``` ## Getting the Return Point Once your workflow is complete, you need to return the user back to the source page. This can be accomplished by navigating to the result of the `get` API. A default location must be provided in case the API can't determine the original source URL. This might occur if the user navigated to the destination directly somehow. ```javascript import { getReturnPoint } from '@brightspace-ui/return-points'; const url = getReturnPoint( 'myKey', '/default/url' ); document.location.href = url; ``` ## Developing After cloning the repo, run `npm install` to install dependencies. ### Linting ```sh npm run lint # lint all files ``` ### Testing ```sh npm run test # run lint and unit tests npm run test:unit # run unit tests ``` ### 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](https://github.com/BrightspaceUI/actions/tree/main/semantic-release) documentation.