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

stamplay-sdk

v2.1.3

Published

JS SDK for Stamplay

Downloads

8

Readme

#Stamplay JavaScript SDK

Build Status Production version Bower version Code Climate

This library gives you access to the powerful Stamplay cloud platform from your JavaScript app. For more info on Stamplay and its features, see the website or the JavaScript guide

##Installation The SDK is available for on NPM, Bower and on our CDN.

###Using npm

$ npm install -g stamplay-sdk

###Using bower 

$ bower install -g stamplay-js-sdk

To get started import the library in your project and initialize it by calling init function with your appId

<script src="https://drrjhlchpvi7e.cloudfront.net/libs/stamplay-js-sdk/2.1.3/stamplay.min.js"></script>
<script> Stamplay.init("APPID"); </script>

##How to use it Register a new user:

var data = {
	"email":"[email protected]",
	"password":"john123"
}
Stamplay.User.signup(data, function(error, result){
	//manage the result and the error
})

Store data using Objects:

var data = {
	"description":"A description",
	"title":"New title"
}
Stamplay.Object('foo').save(data, function(error, result){
	//manage the result and the error
})

Skip the callback to get a promise back

var data = {
	"description":"A description",
	"title":"New title"
}
Stamplay.Object('foo').save(data).then(function(result){
	//manage the result
},function(error){
	//manage the error
})

##Available components This JavaScript SDK expose the following components:

  • User
    • save(data, [callback])
    • get(data, [callback])
    • getById(id, data, [callback])
    • remove(id, [callback])
    • update(id, data, [callback] )
    • currentUser([callback])
    • login(data, [callback])
    • socialLogin(provider)
    • signup(data, [callback])
    • logout(async)
    • resetPassword(data, [callback])
    • getRoles([callback])
    • getRole(id, [callback])
    • setRole(id, roleId, [callback])
  • Object
    • save(data, [callback])
    • get(data, [callback])
    • getById(id, data, [callback])
    • remove(id, [callback])
    • update(id, data, [callback])
    • patch(id, data, [callback])
    • findByCurrentUser([attr], [data], [callback])
    • upVote(id, [callback])
    • downVote(id, [callback])
    • rate(id, rate, [callback])
    • comment(id, text, [callback])
    • push(id, attribute, data, [callback])
  • Code Block
    • post(data, queryParams, [callback])
    • get(queryParams, [callback])
    • put(data, queryParams, [callback])
    • patch(data, queryParams, [callback])
    • delete(queryParams, [callback])
  • Webhook
    • post(data, [callback])
  • Stripe
    • charge(userId, token, amount, currency, [callback])
    • createCreditCard(userId, token, [callback])
    • createCustomer(userId, [callback])
    • createSubscriptionuserId, planId, [callback])
    • deleteSubscription(userId, subscriptionId, options, [callback])
    • getCreditCard(userId, [callback])
    • getSubscription(userId, subscriptionId, [callback])
    • getSubscriptions(userId, options, [callback])
    • updateCreditCard(userId, token, [callback])
    • updateSubscription(userId, subscriptionId, options, [callback])

Also this components the sdk have some support objects to help you in common operation:

  • Query
    • greaterThan(attr, value)
    • greaterThanOrEqual(attr, value)
    • lessThan(attr, value)
    • lessThanOrEqual(attr, value)
    • pagination(page, per_page)
    • between(attr, value1, value2)
    • equalTo(attr, value)
    • notEqualTo(attr, value)
    • exists(attr)
    • notExists(attr)
    • sortAscending(attr)
    • sortDescending(attr)
    • populate()
    • populateOwner()
    • select(attr,...)
    • regex(attr, regex, options)
    • near(type, coordinates, maxDistance, minDistance)
    • nearSphere(type, coordinates, maxDistance, minDistance)
    • geoIntersects(type, coordinates)
    • geoWithinGeometry(type, coordinates)
    • geoWithinCenterSphere(coordinates, radius)
    • or(query,..)
    • exec([callback])

Build

To build a production ready library you need to have NPM and Bower installed and then run those two commands:

npm install && bower install
grunt build

You can also download this project and using all the precompiled files in src folder

Contributing

  1. Fork it ( https://github.com/[my-github-username]/stamplay-js-sdk/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

One more thing

Go to API Reference to see a lot of examples. Enjoy!