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

@datafire/synq_fm

v6.0.0

Published

DataFire integration for SYNQ Video

Downloads

2

Readme

@datafire/synq_fm

Client library for SYNQ Video

Installation and Usage

npm install --save @datafire/synq_fm
let synq_fm = require('@datafire/synq_fm').create();

.then(data => {
  console.log(data);
});

Description

Actions

create

Create a new video, optionally setting some metadata fields. You may optionally set some of the metadata associated with the video. Only fields inside the "userdata" field can be set.

synq_fm.create({
  "api_key": ""
}, context)

Input

  • input object
    • api_key required string
    • userdata string: Additional metadata that will be associated with the video

Output

details

Return details about a video. You may optionally request that only some of the metadata fields are returned.

synq_fm.details({
  "api_key": "",
  "video_id": ""
}, context)

Input

  • input object
    • api_key required string
    • video_id required string: ID of the video to retrieve the metadata from

Output

query

Find videos matching any criteria, by running a JavaScript function over each video object. A detailed tutorial on how to use this functionality is available on the documentation page.

synq_fm.query({
  "api_key": "",
  "filter": ""
}, context)

Input

  • input object
    • api_key required string
    • filter required string: JavaScript code to be run over each video object, to determine what should be returend.

Output

  • output array
    • items object

stream

Returns a stream url that you can stream to from your broadcasting software, and a playback url people can use to watch the stream.

synq_fm.stream({
  "api_key": "",
  "video_id": ""
}, context)

Input

  • input object
    • api_key required string
    • video_id required string: The ID of the video you want to stream to. The video needs to have been previously created.

Output

  • output object
    • playback_url required string
    • stream_url required string

update

Update a video's metadata through JavaScript code. Only fields inside the "userdata" object can be set.

synq_fm.update({
  "api_key": "",
  "video_id": "",
  "source": ""
}, context)

Input

  • input object
    • api_key required string
    • video_id required string: The ID of the video whose metadata will be updated
    • source required string: JavaScript code to execute on the video object.

Output

upload

Return parameters needed for uploading a video file to Amazon Simple Storage Service. See http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html as well as the language-specific code-examples.

Example request

curl -s https://api.synq.fm/v1/video/upload \
  -F api_key=${SYNQ_API_KEY} \
  -F video_id=2d81c30ce62f4dfdb501dbca96c7ae56

Example response

{
  "action": "https://synqfm.s3.amazonaws.com/",
  "AWSAccessKeyId": "AKIAIP77Y7MMX3ITZMFA",
  "Content-Type": "video/mp4",
  "Policy": "eyJleHBpcmF0aW9uIiA6ICIyMDE2LTA0LTIyVDE5OjAyOjI2LjE3MloiLCAiY29uZGl0aW9ucyIgOiBbeyJidWNrZXQiIDogInN5bnFmbSJ9LCB7ImFjbCIgOiAicHVibGljLXJlYWQifSwgWyJzdGFydHMtd2l0aCIsICIka2V5IiwgInByb2plY3RzLzZlLzYzLzZlNjNiNzUyYTE4NTRkZGU4ODViNWNjNDcyZWRmNTY5L3VwbG9hZHMvdmlkZW9zLzJkLzgxLzJkODFjMzBjZTYyZjRkZmRiNTAxZGJjYTk2YzdhZTU2Lm1wNCJdLCBbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAidmlkZW8vbXA0Il0sIFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCAxMDk5NTExNjI3Nzc2XV19",
  "Signature": "ysqDemlKXKr6hKzVFP0hCGgf/cs=",
  "acl": "public-read",
  "key": "projects/6e/63/6e63b752a1854dde885b5cc472edf569/uploads/videos/2d/81/2d81c30ce62f4dfdb501dbca96c7ae56.mp4"
}

To upload the file, you can then make a multipart POST request to the URL in action, and for all the other parameters returned, set them as form parameters.

Given the parameters above, you would upload a file test.mp4 using cURL like this:

curl -s https://synqfm.s3.amazonaws.com/ \
  -F AWSAccessKeyId="AKIAIP77Y7MMX3ITZMFA" \
  -F Content-Type="video/mp4" \
  -F Policy="eyJleHBpcmF0aW9uIiA6ICIyMDE2LTA0LTIyVDE5OjAyOjI2LjE3MloiLCAiY29uZGl0aW9ucyIgOiBbeyJidWNrZXQiIDogInN5bnFmbSJ9LCB7ImFjbCIgOiAicHVibGljLXJlYWQifSwgWyJzdGFydHMtd2l0aCIsICIka2V5IiwgInByb2plY3RzLzZlLzYzLzZlNjNiNzUyYTE4NTRkZGU4ODViNWNjNDcyZWRmNTY5L3VwbG9hZHMvdmlkZW9zLzJkLzgxLzJkODFjMzBjZTYyZjRkZmRiNTAxZGJjYTk2YzdhZTU2Lm1wNCJdLCBbInN0YXJ0cy13aXRoIiwgIiRDb250ZW50LVR5cGUiLCAidmlkZW8vbXA0Il0sIFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCAxMDk5NTExNjI3Nzc2XV19" \
  -F Signature="ysqDemlKXKr6hKzVFP0hCGgf/cs=" \
  -F acl="public-read" \
  -F key="projects/6e/63/6e63b752a1854dde885b5cc472edf569/uploads/videos/2d/81/2d81c30ce62f4dfdb501dbca96c7ae56.mp4" \
  -F file="@my_video_file.mp4"
synq_fm.upload({
  "api_key": "",
  "video_id": ""
}, context)

Input

  • input object
    • api_key required string
    • video_id required string: The ID of the video you are going to upload into. The video needs to have been previously created.

Output

uploader

Returns an embeddable url, that contains an uploader widget that allows you to easily upload any mp4. Great way to simplify the uploading process for end users.

synq_fm.uploader({
  "api_key": "",
  "video_id": ""
}, context)

Input

  • input object
    • api_key required string
    • video_id required string: The ID of the video you are going to upload into. The video needs to have been previously created.
    • timeout string: How long the uploader widget works for. Anything from '30 minutes' to '2 days'.

Output

  • output object
    • uploader_url string

Definitions

ErrorObject

  • ErrorObject object
    • details object
    • message required string
    • name required string
    • url required string

StreamConfigurationObject

  • StreamConfigurationObject object
    • rtmp_host string
    • rtmp_key string
    • rtmp_port string
    • rtmp_url string

UploadParameterObject

  • UploadParameterObject object
    • AWSAccessKeyId string
    • Content-Type string
    • Policy string
    • Signature string
    • acl string
    • action string
    • key string

VideoObject

  • VideoObject object
    • created_at required string
    • input object
    • outputs object
    • state required string
    • updated_at required string
    • userdata required object
    • video_id required string