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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rets-rabbit-angular

v1.1.11

Published

This is an angular module which provides several factories and services to interface with the Retsrabbit V2 API

Readme

Rets-Rabbit-Angular

This is an angular module which provides a variety of factories and services which hit the Rets Rabbit API


Get Started

You can install this package via bower

$ bower install rets-rabbit-angular

Usage

  1. Factories
  2. Providers

Factories

This package comes with several factories:

  • RRAuthFactory
  • PropertyFactoryV1
  • PropertyFactoryV2

RRAuthFactory

This factory has two publicly available methods:

  1. getTokenV1: returns a response from the Retsrabbit API containing an access_token
  2. getTokenV2: returns a response from the Retsrabbit API containing an access_token

getTokenV1

RRAuthFactory.getTokenV1().then(function (res){
    //getToken automatically saves the access_token in localStorage
	var token = res.access_token;
	//do stuff with token
}, function (err){
	//handle error
});

getTokenV2

RRAuthFactory.getTokenV2().then(function (res){
    //getToken automatically saves the access_token in localStorage
	var token = res.access_token;
	//do stuff with token
}, function (err){
	//handle error
});

PropertyFactoryV1

This factory has three public methods:

  1. search
  2. metadata
  3. servers

object search(string server_hash, string query)

object metadata(string serverh_hash)

PropertyFactoryV1.metadata('somehashstring').then(function (res) {
    //show metadata
}, function (err) {
    //handle err
});

object servers()

PropertyFactoryV1.servers().then(function (res) {
    //show servers
}, function (err) {
    //handle error
});

PropertyFactoryV2

This factory has three publicly available methods:

  1. search: accepts an unencoded ODATA query string and returns the results from the server
  2. findOne: find a single listing by ListingId
  3. metadata: fetch the metadata for your server

object search(string params)

var query = "$select=ListPrice, ListingId, OriginalListPrice&$filter=ListPrice gt OriginalListPrice&$orderby=ListPrice asc";

PropertyFactoryV2.search(query).then(function (res){
	var total_count = res['@retsrabbit.total_results'];
	var count = res['@odata.count'];
	var results = res.value;
	
	//do awesome things with results
}, function (err){
	//handle error
});

object findOne(int id, string query)

var id = '1234';
var query = '$select=ListPrice, ListAgentFirstName';

PropertyFactoryV2.findOne(id, query).then(function(listing) {
    //show off the listing
}, function (err) {
    //handle error
});

object metadata()

PropertyFactoryV2.metadata().then(function (res) {
    //do things with metadata
}, function (err) {
    //handle error
});

Providers

This package comes with one provider:

  1. ApiConfig

ApiConfig

This provider has two different classes to handle setting the V1 and V2 config values. To access either class, you just need to append v1 or v2 to the provider.

This provider has several setters which can be used to configure the service inside of an angular config module.

  • setBaseUrl: Used to set the base url for querying. For example, https://api.retsrabbit.com/

  • setApiEndPoint: Used to set the specific versioning. For example, api/v2

  • setClientId: Used to set the client_id which can be found under the API page on the Retsrabbit dashboard

  • setClientSecret: Used to set the client_secret which can be found under the API page on the Retsrabbit dashboard

  • setStorageKey: Use to set the local storage key for the access_token sent back by the server.

An example of using the setters can be seen below.

Make sure you suffix the provider with the "Provider" keyword when injecting into a config module so that angular knows you are using it as a Provider and not a service/factory.

ApiConfigProvider.v1.setBaseUrl("https://api.retsrabbit.com/");

ApiConfigProvider.v1.setClientId("clientidgoeshere");

ApiConfigProvider.v1.setClientSecret("supersecretpassword");

ApiConfigProvider.v1.setStorageKey("access_token_v1");

The provider has several public getters which can be used to get api related information.

  • baseUrl: Just returns the base url set in the getter
  • apiUrl: Returns the base url plus the api endpoint
  • clientId: Returns the client_id
  • clientSecret: Returns the client_secret
  • storageKey: Returns the local storage key for the access token