How to use @bbp/nexus-sdk - 2 common examples

To help you get started, we’ve selected a few @bbp/nexus-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BlueBrain / nexus-js / apps / search-poc / scripts / createStudio.js View on Github external
],
};

const logger = (operation, forward) => {
  const { method = 'GET', path, body = '{}' } = operation;
  const { '@id': id = null, label = null } = JSON.parse(body);
  const type = path.split('/').reduce((prev, curr) => {
    if (curr === 'v1') return curr;
    if (prev === 'v1') return curr;
    return prev;
  });
  console.log(`operation => ${method} ${id || label || ''} on ${type}`);
  return forward(operation);
};

const nexus = createNexusClient({
  fetch,
  uri: config.environment,
  token: '', // PUT YOUR TOKEN HERE
  links: [logger],
});

async function main() {
  try {
    const ThalamusWorkspaceConfig = {
      name: 'Thalamus2019 Workspace',
      filters: {
        brainRegion: 'http://purl.obolibrary.org/obo/UBERON_0004703',
      },
    };
    const NeocortexWorkspaceConfig = {
      name: 'SSCx 2019 Workspace',
github BlueBrain / nexus-js / apps / search-poc / src / index.tsx View on Github external
async function main() {
  const [userManager, user] = await setUpSession();
  // create nexus instance
  const nexus: NexusClient = createNexusClient({
    fetch,
    uri: SETTINGS.environment,
    links: [setToken],
  });

  const rootElement = document.getElementById('root');
  render(
    
      <header>
      
        </header>

@bbp/nexus-sdk

REST API abstraction for Nexus

Apache-2.0
Latest version published 2 years ago

Package Health Score

49 / 100
Full package analysis

Popular @bbp/nexus-sdk functions