npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bullhorn/taurus

v3.9.2

Published

A simple client library for Bullhorn

Downloads

601

Readme

TAURUS

The official client library for connecting to Bullhorn REST API


Dependency Status XO code style npm version semantic-release


WebsiteDocsBlog

What can Taurus do?

  • Authentication - built-in authentication functionality.
  • Realtime bindings - Synchronize database collections as objects or lists.
  • Note - Taurus is designed for use only in client side environments.

Install

npm install --save @bullhorn/taurus @bullhorn/bullhorn-types

Authentication

First, in the src folder create an app.js file. Then, you will need setup your Application with the credentials provided to you by Bullhorn.

Note: Don't have a clientId? Partner keys are only available directly from Bullhorn. If you are interested in becoming a partner, send a email message to [email protected] or fill out the form available at the Bullhorn Marketplace.

app.js

import { Staffing, StaffingCredentialsAuthProvider } from '@bullhorn/taurus';

const provider = new StaffingCredentialsAuthProvider('docsamson', 'secrets');
const staffing: Staffing = new Staffing({
  restUrl: 'https://login.bullhorn.com',
  BhRestToken: '~BULLHORN_REST_TOKEN~',
});

staffing.login(provider).then(() => {
  console.log('We Are Doing it!');
});

// or

const app = Staffing.loginWithPopup('https://login.bullhorn.com');

Getting the data

Now we need to get some data. Taurus provides several convience function to Search and retrieve entities within the system.

Object Data

For this example we are going to get and entiy by id.

import { EntityTypes, Candidate } from '@bullhorn/bullhorn-types';
import { Entity } from '@bullhorn/taurus';

let record: Entity<Candidate> = new Entity(EntityTypes.Candidate).fields('id', 'name');
// Populate from server with data for Candidate #100
record.get(100);
// Listen for changes
record.subscribe((response) => {
  console.log(record.data);
  // output: {id: 100, name: 'Theodore'}
});

List Data

For this example we are going to search for some Jobs and display a list of them.

import { EntityTypes, Candidate } from '@bullhorn/bullhorn-types';
import { EntityList } from '@bullhorn/taurus';

let list: EntityList<Candidate> = new EntityList(EntityTypes.Candidate, {
  fields: ['id', 'name'],
  startAt: 0,
  limitTo: 25,
  filter: { isDeleted: 0 },
});

list.subscribe((response) => {
  let total = list.info.total;
  // TODO: Finish this
});

Lets Get Started

This tutorial will take you through creating a simple application using Taurus and briefly explain its main concepts. We assume you are familiar with JavaScript, HTML, and CSS. To get a quick overview, we recommend you skip down to the section titled "Setting Up The HTML Page" so you can see how to use Taurus straight away. To view the completed results of this tutorial, please have a look at our examples project.

Configuring Your Environment

Let's start by getting you set up with a great set of tools that you can use to build modern JavaScript applications. All our tooling is built on Node.js. If you have that installed already, great! If not, you should go to the official web site, download and install it. Everything else we need will be installed via Node's package manager (npm).

Setting Up The HTML Page

If you've followed along this far, you now have all the libraries, build configuration and tools you need to create amazing JavaScript apps with Taurus. The next thing we need to do is create our index.html file in the root of our project folder. Create that now and use the markup below.

index.html

<!doctype html>
<html>
  <head>
	<link rel="stylesheet" type="text/css" href="//cdn.bullhorn.com/bullhorncss/1.0/bullhorn.css">
	<script src="//unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script>
	<script src="//unpkg.com/axios/dist/axios.min.js"></script>
	<script src="//unpkg.com/@bullhorn/[email protected]/lib/index.umd.js"></script>
	<script>
        var provider = new taurus.StaffingCredentialsAuthProvider('docsamson', 'secretpassword');
        var staffing = new taurus.Staffing({
            useCookies: false,
            client_id: '~~YOUR-BULLHORN-CLIENT-ID~~',
            apiVersion: '*',
            redirect_url: 'http://your-app.com',
            authorization_url: 'http://auth.bullhornstaffing.com/oauth/authorize',
            token_url: 'http://auth.bullhornstaffing.com/oauth/token',
            login_url: 'http://rest.bullhornstaffing.com/rest-services/login'
        });

        staffing.login(provider).then(() => {
            // Now we are authenticated
            var list = new taurus.EntityList('Candidate', {
                fields: ['id', 'name'],
                startAt: 0,
                limitTo: 25,
                filter: { isDeleted: 0 }
            });
            list.subscribe((results) => {
				// The list has retrieved your results
                console.log('Results: ', results);
                console.log('Total Candidate: ', list.info.total);
            });
        });
    </script>
  </head>
  <body>
  </body>
</html>

Yes, that's it. This is the only HTML page in our application.

View the page

We can install another npm package called live-server. This with host our application and watch the directory structure for any changes, there is no configuration, so it always works.

npm install -g live-server

You can now browse to http://localhost:8080/ to see the app.

Let's recap. To add a page to your app:

  1. Add your SDK Credentials
  2. Authenticate
  3. Get data from Bullhorn
  4. Celebrate.

Conclusion

With its strong focus on developer experience, Taurus can enable you to not only create amazing applications, but also enjoy the process. We've designed it with simple conventions in mind so you don't need to waste time with tons of configuration or write boilerplate code just to satisfy a stubborn or restrictive framework.

If you need more help, check out the Documentation and Api Reference