Options
All
  • Public
  • Public/Protected
  • All
Menu

Procore JS SDK

CircleCI

A node.js and browser compatible JS SDK for the procore API.

Installation

yarn add @procore/sdk

We recommend installing the package with yarn

Example

Setting up a server

import 'isomorphic-fetch';
import { client, oauth, refresher } from 'procore';
import me from 'procore/me';
import projects from 'procore/projects';

const token = document.head.querySelector('value=auth_token').getAttribute('content');

const authorizer = oauth({ token });

const refreshToken = token => fetch(
  '/oauth/procore/refresh',
  { method: 'POST', headers: { 'Authorization': `Bearer ${token}` } }
);

const procore = client(
  refresher(authorizer, refreshToken)
);

Promise.all([
  procore.get(me()),
  procore.get(projects({ company_id: 2 }))
])
.then(onSuccess);

Tests

yarn test

Endpoint Generator

node-procore-endpoints generates interfaces and endpoint functions for improved developer experience. See the project for more details.

interface DirectCosts {
  action: string;
  qs?: any;
  id?: number;
  project_id: number;

}

function directCosts({ action, qs, id, project_id }: DirectCosts): any {
  return {
    base: '/vapid/projects/{project_id}/direct_costs',
    action,
    params: { id, project_id },
    qs
  }
}

export default directCosts

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/procore/node-procore. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The package is available as open source under the terms of the MIT License.

About Procore

Procore Logo

Manage Version is maintained by Procore Technologies.

Procore - building the software that builds the world.

Learn more about the #1 most widely used construction management software at procore.com

Generated using TypeDoc