Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

JavaScript client API for LabKey Server

License

NotificationsYou must be signed in to change notification settings

LabKey/labkey-api-js

Repository files navigation

API Docs |Change Log |License |Build Status

JavaScript package for interacting withLabKey Server. The goal for this package is toprovide a robust set of JavaScript tools for working with LabKey Servers. Our eventual hope is to have it workingin the browser, on the server, and in pretty much any modern JavaScript environment. The package currently onlysupports use in the browser.

Written with joy in TypeScript.

v1.0 - Official stable release

v1.0 is the first stable release of the@labkey/api package. This package is the official JavaScript API package forLabKey Server and is included starting with LabKey Server v20.7. Release highlights:

  • Replaces the original JavaScript API served underLABKEY global namespace on LabKey Server pages.
  • Universal module definition (UMD) published package targeting ES6.
  • Full fidelity TypeScript definitions.

Pre-v1.0 usage

It is highly recommended you update to the 1.x version of this package as soon as possible. Any pre-1.0 releases areconsidered experimental and were used only for development purposes.

Installation

The easiest way to use @labkey/api is to install it from npm and bundle it with your app. Before you run installyou'll want to make sure you set the appropriate registry for the@labkey scope.

Setting the Registry Scope

This package is currently available on LabKey's Artifactory package registry. To include this package set the registryin npm for the@labkey scope. This can be done via command line usingnpm config:

npm config set @labkey:registry https://labkey.jfrog.io/artifactory/api/npm/libs-client

or via a.npmrc file

# .npmrc@labkey:registry=https://labkey.jfrog.io/artifactory/api/npm/libs-client

Installing

To install using npm

npm install @labkey/api

You can then import @labkey/api in your application as follows:

import{Query,Security}from'@labkey/api';

Development

If you would like to contribute changes to this package it is straightforward to get set up for development.First, clone this repository to a directory

git clone https://github.com/LabKey/labkey-api-js.git# or via ssh

Navigate into the package directory and run the following commands

npm installnpm run build

Now that the distribution is built you can load it up by serving the index.html file found in the package root. Toserve it up from IntelliJ you can "Open in Browser". This will let you explore the API as it is exposed viatheLABKEY global namespace.

Local LabKey Server

To make changes to this package and serve those changes from a local LabKey Server instance youcan do so via the following steps:

  1. Build the package (as described above).
  2. Copy the package's/dist directory to/<labkey root>/server/modules/platform/core/node_modules/@labkey/api/dist.
  3. Navigate to/<labkey root>/server/modules/platform/core.
  4. Runnpm run copy-distributions from thecore module directory.

Your changes will now be included in the bundle served by your local LabKey Server instance.

Determining package version

If you're using this package from a LabKey Server page you can verify the package version being used by opening thebrowser console and typing:

LABKEY.__package__

The__package__ object will contain package information such as the version of the package you're using.

// LABKEY.__package__{description:"JavaScript client API for LabKey Server",name:"@labkey/api",version:"1.0.0"}

Publishing

To publish, increment the version number in accordance withSemVer, update the CHANGELOG.md,and commit. Then from the package root run

npm publish

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp