A node.\+js Java\+Script client for working with \href{http://browserstack.com}{\texttt{ Browser\+Stack}} through its \href{https://github.com/browserstack/api}{\texttt{ REST API}} ({\itshape aka} Javascript Testing API), \href{https://www.browserstack.com/automate/rest-api}{\texttt{ Automate API}}, \href{https://www.browserstack.com/app-automate/rest-api}{\texttt{ App Automate API}}, and \href{https://www.browserstack.com/screenshots/api}{\texttt{ Screenshots API}}.\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4592}{}\doxysection{Installation}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4592}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm install browserstack }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4593}{}\doxysection{Usage}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4593}

\begin{DoxyCode}{0}
\DoxyCodeLine{var BrowserStack = require("{}browserstack"{});}
\DoxyCodeLine{var browserStackCredentials = \{}
\DoxyCodeLine{    username: "{}foo"{},}
\DoxyCodeLine{    password: "{}p455w0rd!!1"{}}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{// REST API}
\DoxyCodeLine{var client = BrowserStack.createClient(browserStackCredentials);}
\DoxyCodeLine{}
\DoxyCodeLine{client.getBrowsers(function(error, browsers) \{}
\DoxyCodeLine{    console.log("{}The following browsers are available for testing"{});}
\DoxyCodeLine{    console.log(browsers);}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{// Automate API}
\DoxyCodeLine{var automateClient = BrowserStack.createAutomateClient(browserStackCredentials);}
\DoxyCodeLine{}
\DoxyCodeLine{automateClient.getBrowsers(function(error, browsers) \{}
\DoxyCodeLine{    console.log("{}The following browsers are available for automated testing"{});}
\DoxyCodeLine{    console.log(browsers);}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{// App Automate API}
\DoxyCodeLine{// Show the upload builds for mobile app automation}
\DoxyCodeLine{var appAutomateClient = BrowserStack.createAppAutomateClient(browserStackCredentials);}
\DoxyCodeLine{}
\DoxyCodeLine{appAutomateClient.getBuilds(function(error, builds) \{}
\DoxyCodeLine{    console.log("{}The following builds are available for app automated testing"{});}
\DoxyCodeLine{    console.log(builds);}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{// Screenshots API}
\DoxyCodeLine{var screenshotClient = BrowserStack.createScreenshotClient(browserStackCredentials);}
\DoxyCodeLine{}
\DoxyCodeLine{screenshotClient.getBrowsers(function(error, browsers) \{}
\DoxyCodeLine{    console.log("{}The following browsers are available for screenshots"{});}
\DoxyCodeLine{    console.log(browsers);}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4594}{}\doxysection{API}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4594}
\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4595}{}\doxysubsection{Objects}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4595}
\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4596}{}\doxysubsubsection{browser objects}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4596}
A common pattern in the APIs is a \char`\"{}browser object\char`\"{} which is just a plain object with the following properties\+:


\begin{DoxyItemize}
\item {\ttfamily os}\+: The operating system.
\item {\ttfamily os\+\_\+version}\+: The operating system version.
\item {\ttfamily browser}\+: The browser name.
\item {\ttfamily browser\+\_\+version}\+: The browser version.
\item {\ttfamily device}\+: The device name.
\end{DoxyItemize}

A browser object may only have one of {\ttfamily browser} or {\ttfamily device} set; which property is set will depend on {\ttfamily os}.\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4597}{}\doxysubsubsection{worker objects}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4597}
Worker objects are extended \href{\#browser-objects}{\texttt{ browser objects}} which contain the following additional properties\+:


\begin{DoxyItemize}
\item {\ttfamily id}\+: The worker id.
\item {\ttfamily status}\+: A string representing the current status of the worker.
\begin{DoxyItemize}
\item Possible statuses\+: {\ttfamily \char`\"{}running\char`\"{}}, {\ttfamily \char`\"{}queue\char`\"{}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4598}{}\doxysubsubsection{project objects}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4598}
Project objects are plain objects which contain the following properties\+:


\begin{DoxyItemize}
\item {\ttfamily id}\+: The id of the project.
\item {\ttfamily name}\+: The name of the project.
\item {\ttfamily created\+\_\+at}\+: When the project was created.
\item {\ttfamily updated\+\_\+at}\+: When the project was most recently updated.
\item {\ttfamily user\+\_\+id}
\item {\ttfamily group\+\_\+id}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4599}{}\doxysubsubsection{build objects}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4599}
Build objects are plain objects which contain the following properties\+:


\begin{DoxyItemize}
\item {\ttfamily hashed\+\_\+id}\+: The hashed if of the build.
\item {\ttfamily name}\+: The name of the build.
\item {\ttfamily status}\+: The status of the build.
\item {\ttfamily duration}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4600}{}\doxysubsubsection{extended build objects}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4600}
Extended build objects are \href{\#build-objects}{\texttt{ build objects}} with the following additional properties\+:


\begin{DoxyItemize}
\item {\ttfamily id}\+: The id of the build.
\item {\ttfamily automation\+\_\+project\+\_\+id}\+: The id of the project this build belongs to.
\item {\ttfamily updated\+\_\+at}\+: When the build was created.
\item {\ttfamily created\+\_\+at}\+: When the build was most recently updated.
\item {\ttfamily delta}
\item {\ttfamily tags}
\item {\ttfamily user\+\_\+id}
\item {\ttfamily group\+\_\+id}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4601}{}\doxysubsubsection{session objects}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4601}
Session objects are extended \href{\#browser-objects}{\texttt{ browser objects}} which contain the following additional properties\+:


\begin{DoxyItemize}
\item {\ttfamily hashed\+\_\+id}\+: The hashed ID of the session.
\item {\ttfamily name}\+: The name of the session.
\item {\ttfamily build\+\_\+name}\+: The name of the build this session belongs to.
\item {\ttfamily project\+\_\+name}\+: The name of the project this session belongs to.
\item {\ttfamily status}\+: The status of the session.
\item {\ttfamily browser\+\_\+url}\+: The most recenly loaded URL the worker.
\item {\ttfamily duration}\+: The duration in seconds that the session has been active.
\item {\ttfamily logs}\+: The URL for the session logs.
\item {\ttfamily video\+\_\+url}\+: The URL for the session video.
\item {\ttfamily reason}\+: The reason the session was terminated.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4602}{}\doxysubsubsection{screenshot job objects}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4602}
Screenshot job objects are plain objects which contain the following properties\+:


\begin{DoxyItemize}
\item {\ttfamily job\+\_\+id}\+: The id of the job.
\item {\ttfamily state}\+: The state of the job.
\item {\ttfamily win\+\_\+res}\+: The screen resolution for browsers running on Windows. May be one of\+: {\ttfamily \char`\"{}1024x768\char`\"{}}, {\ttfamily \char`\"{}1280x1024\char`\"{}}.
\item {\ttfamily mac\+\_\+res}\+: The screen resolution for browsers running on Mac OS X. May be one of\+: {\ttfamily \char`\"{}1024x768\char`\"{}}, {\ttfamily \char`\"{}1280x960\char`\"{}}, {\ttfamily \char`\"{}1280x1024\char`\"{}}, {\ttfamily \char`\"{}1600x1200\char`\"{}}, {\ttfamily \char`\"{}1920x1080\char`\"{}}.
\item {\ttfamily orientation}\+: The screen orientation for devices. May be one of\+: {\ttfamily \char`\"{}portrait\char`\"{}}, {\ttfamily \char`\"{}landscape\char`\"{}}.
\item {\ttfamily quality}\+: The quality of the screenshot. May be one of\+: {\ttfamily \char`\"{}original\char`\"{}}, {\ttfamily \char`\"{}compressed\char`\"{}}.
\item {\ttfamily wait\+\_\+time}\+: The number of seconds to wait before taking the screenshot. May be one of\+: {\ttfamily 2}, {\ttfamily 5}, {\ttfamily 10}, {\ttfamily 15}, {\ttfamily 20}, {\ttfamily 60}.
\item {\ttfamily local}\+: Boolean indicating whether a local testing connection should be used.
\item {\ttfamily browsers}\+: A collection of \href{\#browser-objects}{\texttt{ browser objects}} indicating which browsers and devices to take screenshots with.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4603}{}\doxysubsection{screenshot state objects}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4603}
Screenshot state objects are extended \href{\#browser-objects}{\texttt{ browser objects}} which contain the following additional properties\+:


\begin{DoxyItemize}
\item {\ttfamily id}\+: The id of the screenshot object.
\item {\ttfamily state}\+: The state of the screenshot.
\item {\ttfamily url}\+: The URL of the page the screenshot was generated from.
\item {\ttfamily thumb\+\_\+url}\+: The URL for the screenshot thumbnail.
\item {\ttfamily image\+\_\+url}\+: The URL for the full-\/size screenshot.
\item {\ttfamily created\+\_\+at}\+: The timestamp indicating when the screenshot was generated.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4604}{}\doxysubsection{REST API v4}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4604}
{\itshape Note\+: For earlier versions of the API, please see \href{https://github.com/scottgonzalez/node-browserstack/wiki/API}{\texttt{ the wiki}}.}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4605}{}\doxysubsubsection{Browser\+Stack.\+create\+Client(settings)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4605}
Creates a new client instance.


\begin{DoxyItemize}
\item {\ttfamily settings}\+: A hash of settings that apply to all requests for the new client.
\begin{DoxyItemize}
\item {\ttfamily username}\+: The username for the Browser\+Stack account.
\item {\ttfamily password}\+: The password for the Browser\+Stack account.
\item {\ttfamily version} (optional; default\+: {\ttfamily 4})\+: Which version of the Browser\+Stack API to use.
\item {\ttfamily server} (optional; default\+: {\ttfamily \{ host\+: \char`\"{}api.\+browserstack.\+com\char`\"{}, port\+: 80 \}})\+: An object containing {\ttfamily host} and {\ttfamily port} to connect to a different Browser\+Stack API compatible service.
\item {\ttfamily proxy} (optional; default\+: {\ttfamily null})\+: Proxy server supporting HTTPS to be used for connecting to Browser\+Stack (or {\ttfamily settings.\+server}). e.\+g. {\ttfamily \char`\"{}http\+://proxy.\+example.\+com\+:1234\char`\"{}}
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4606}{}\doxysubsubsection{client.\+get\+Browsers(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4606}
Gets the list of available browsers.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, browsers)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily browsers}\+: An array of \href{\#browser-objects}{\texttt{ browser objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4607}{}\doxysubsubsection{client.\+create\+Worker(settings, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4607}
Creates a worker.


\begin{DoxyItemize}
\item {\ttfamily settings}\+: A hash of settings for the worker (an extended \href{\#browser-objects}{\texttt{ browser object}}).
\begin{DoxyItemize}
\item {\ttfamily os}\+: See \href{\#browser-objects}{\texttt{ browser object}} for details.
\item {\ttfamily os\+\_\+version}\+: See \href{\#browser-objects}{\texttt{ browser object}} for details.
\item {\ttfamily browser}\+: See \href{\#browser-objects}{\texttt{ browser object}} for details.
\item {\ttfamily browser\+\_\+version}\+: See \href{\#browser-objects}{\texttt{ browser object}} for details.
\item {\ttfamily device}\+: See \href{\#browser-objects}{\texttt{ browser object}} for details.
\item {\ttfamily url} (optional)\+: Which URL to navigate to upon creation.
\item {\ttfamily timeout} (optional)\+: Maximum life of the worker (in seconds). Maximum value of {\ttfamily 1800}. Specifying {\ttfamily 0} will use the default of {\ttfamily 300}.
\item {\ttfamily name} (optional)\+: Provide a name for the worker.
\item {\ttfamily build} (optional)\+: Group workers into a build.
\item {\ttfamily project} (optional)\+: Provide the project the worker belongs to.
\item {\ttfamily browserstack.\+video} (optional)\+: Set to {\ttfamily false} to disable video recording.
\end{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, worker)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily worker} A \href{\#worker-objects}{\texttt{ worker object}}.
\end{DoxyItemize}
\end{DoxyItemize}

{\itshape Note\+: A special value of {\ttfamily \char`\"{}latest\char`\"{}} is supported for {\ttfamily browser\+\_\+version}, which will use the latest stable version.}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4608}{}\doxysubsubsection{client.\+get\+Worker(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4608}
Gets the status of a worker.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The id of the worker.
\item {\ttfamily callback} ({\ttfamily function(error, worker)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily worker}\+: A \href{\#worker-objects}{\texttt{ worker object}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4609}{}\doxysubsubsection{client.\+change\+Url(id, options, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4609}
Change the URL of a worker.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The id of the worker.
\item {\ttfamily options}\+: Configuration for the URL change.
\begin{DoxyItemize}
\item {\ttfamily url}\+: The new URL to set.
\item {\ttfamily timeout} (optional)\+: Set a new timeout for this worker, see \href{\#client.CreateWorker}{\texttt{ create\+Worker}} for details.
\end{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, data)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily data}\+: An object with a {\ttfamily message}, confirming the URL change.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4610}{}\doxysubsubsection{client.\+terminate\+Worker(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4610}
Terminates an active worker.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The id of the worker to terminate.
\item {\ttfamily callback} ({\ttfamily function(error, data)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily data}\+: An object with a {\ttfamily time} property indicating how long the worker was alive.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4611}{}\doxysubsubsection{client.\+get\+Workers(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4611}
Gets the status of all workers.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, workers)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily workers}\+: An array of \href{\#worker-objects}{\texttt{ worker objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4612}{}\doxysubsubsection{client.\+take\+Screenshot(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4612}
Take a screenshot at current state of worker.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, data)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily data}\+: An object with a {\ttfamily url} property having the public url for the screenshot.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4613}{}\doxysubsubsection{client.\+get\+Latest(browser, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4613}
Gets the latest version of a browser.


\begin{DoxyItemize}
\item {\ttfamily browser}\+: Which browser to get the latest version for. See \href{\#browser-objects}{\texttt{ browser object}} for details.
\item {\ttfamily callback} ({\ttfamily function(error, version)})\+: A callback to invoke when the version is determined.
\begin{DoxyItemize}
\item {\ttfamily version}\+: The latest version of the browser.
\end{DoxyItemize}
\end{DoxyItemize}

{\itshape Note\+: Since mobile devices do not have version numbers, there is no latest version.}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4614}{}\doxysubsubsection{client.\+get\+Latest(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4614}
Gets the latest version of all browsers.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, versions)})\+: A callback to invoke when the versions are determined.
\begin{DoxyItemize}
\item {\ttfamily versions}\+: A hash of browser names and versions.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4615}{}\doxysubsubsection{client.\+get\+Api\+Status(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4615}

\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, status)})\+: A callback to invoke when the status is determined.
\begin{DoxyItemize}
\item {\ttfamily used\+\_\+time}\+: Time used so far this month, in seconds.
\item {\ttfamily total\+\_\+available\+\_\+time}\+: Total available time, in seconds. Paid plans have unlimited API time and will receive the string {\ttfamily \char`\"{}\+Unlimited Testing Time\char`\"{}} instead of a number.
\item {\ttfamily running\+\_\+sessions}\+: Number of running sessions.
\item {\ttfamily sessions\+\_\+limit}\+: Number of allowable concurrent sessions.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4616}{}\doxysubsection{Automate API}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4616}
\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4617}{}\doxysubsubsection{Browser\+Stack.\+create\+Automate\+Client(settings)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4617}
Creates a new client instance.


\begin{DoxyItemize}
\item {\ttfamily settings}\+: A hash of settings that apply to all requests for the new client.
\begin{DoxyItemize}
\item {\ttfamily username}\+: The username for the Browser\+Stack account.
\item {\ttfamily password}\+: The password for the Browser\+Stack account.
\item {\ttfamily proxy} (optional; default\+: {\ttfamily null})\+: Proxy server supporting HTTPS to be used for connecting to Browser\+Stack. e.\+g. {\ttfamily \char`\"{}http\+://proxy.\+example.\+com\+:1234\char`\"{}}
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4618}{}\doxysubsubsection{automate\+Client.\+get\+Plan(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4618}
Gets information about your group\textquotesingle{}s Automate plan, including the maximum number of parallel sessions allowed and the number of parallel sessions currently running.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, plan)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily plan}\+: An object with {\ttfamily parallel\+\_\+sessions\+\_\+max\+\_\+allowed}, {\ttfamily parallel\+\_\+sessions\+\_\+running}, and {\ttfamily automate\+\_\+plan} showing the current state of your plan.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4619}{}\doxysubsubsection{automate\+Client.\+get\+Browsers(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4619}
Gets the list of available browsers.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, browsers)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily browsers}\+: An array of \href{\#browser-objects}{\texttt{ browser objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4620}{}\doxysubsubsection{automate\+Client.\+get\+Projects(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4620}
Gets the list of projects.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, projects)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily projects}\+: An array of \href{\#project-objects}{\texttt{ project objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4621}{}\doxysubsubsection{automate\+Client.\+get\+Project(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4621}
Gets information about a project.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The ID of the project.
\item {\ttfamily callback} ({\ttfamily function(error, project)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily project}\+: A \href{\#project-objects}{\texttt{ project object}} including an array of \href{\#build-objects}{\texttt{ extended build objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4622}{}\doxysubsubsection{automate\+Client.\+get\+Builds(\mbox{[}options,\mbox{]} callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4622}
Gets the list of builds.


\begin{DoxyItemize}
\item {\ttfamily options} (optional)\+: An object containing search parameters.
\begin{DoxyItemize}
\item {\ttfamily limit}\+: The number of builds to return. Defaults to {\ttfamily 10}.
\item {\ttfamily status}\+: Filter builds based on status. May be one of {\ttfamily \char`\"{}running\char`\"{}}, {\ttfamily \char`\"{}done\char`\"{}}, {\ttfamily \char`\"{}failed\char`\"{}}, {\ttfamily \char`\"{}timeout\char`\"{}}.
\end{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, builds)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily builds}\+: An array of \href{\#build-objects}{\texttt{ build objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4623}{}\doxysubsubsection{automate\+Client.\+get\+Sessions(build\+Id, \mbox{[}options,\mbox{]} callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4623}
Gets the list of sessions in a build.


\begin{DoxyItemize}
\item {\ttfamily build\+Id}\+: The hashed ID of the build.
\item {\ttfamily options} (optional)\+: An object containing search parameters.
\begin{DoxyItemize}
\item {\ttfamily limit}\+: The number of sessions to return. Defaults to {\ttfamily 10}.
\item {\ttfamily status}\+: Filter sessions based on status. May be one of {\ttfamily \char`\"{}running\char`\"{}}, {\ttfamily \char`\"{}done\char`\"{}}, {\ttfamily \char`\"{}failed\char`\"{}}.
\end{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, sessions)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily sessions}\+: An array of \href{\#session-objects}{\texttt{ session objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4624}{}\doxysubsubsection{automate\+Client.\+get\+Session(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4624}
Gets the details for a session.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The hashed ID of the session.
\item {\ttfamily callback} ({\ttfamily function(error, session)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily session}\+: A \href{\#session-objects}{\texttt{ session object}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4625}{}\doxysubsubsection{automate\+Client.\+update\+Session(id, options, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4625}
Updates the status of a session.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The hashed ID of the session.
\item {\ttfamily options}\+: An object containing the parameters.
\begin{DoxyItemize}
\item {\ttfamily status}\+: New status value. \href{https://www.browserstack.com/automate/rest-api\#rest-api-sessions}{\texttt{ May be one of}} {\ttfamily \char`\"{}completed\char`\"{}} or {\ttfamily \char`\"{}error\char`\"{}}.
\end{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, session)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily session}\+: The updated \href{\#session-objects}{\texttt{ session object}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4626}{}\doxysubsubsection{automate\+Client.\+delete\+Session(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4626}
Deletes a session.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The hashed ID of the session.
\item {\ttfamily callback} ({\ttfamily function(error, data)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily data}\+: An object with a {\ttfamily message}, confirming the deletion.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4627}{}\doxysubsection{App Automate API}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4627}
\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4628}{}\doxysubsubsection{Browser\+Stack.\+create\+App\+Automate\+Client(settings)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4628}
Creates a new client instance.


\begin{DoxyItemize}
\item {\ttfamily settings}\+: A hash of settings that apply to all requests for the new client.
\begin{DoxyItemize}
\item {\ttfamily username}\+: The username for the Browser\+Stack account.
\item {\ttfamily password}\+: The password for the Browser\+Stack account.
\item {\ttfamily proxy} (optional; default\+: {\ttfamily null})\+: Proxy server supporting HTTPS to be used for connecting to Browser\+Stack. e.\+g. {\ttfamily \char`\"{}http\+://proxy.\+example.\+com\+:1234\char`\"{}}
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4629}{}\doxysubsubsection{automate\+Client.\+get\+Plan(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4629}
Gets information about your group\textquotesingle{}s App Automate plan, including the maximum number of parallel sessions allowed and the number of parallel sessions currently running.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, plan)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily plan}\+: An object with {\ttfamily parallel\+\_\+sessions\+\_\+max\+\_\+allowed}, {\ttfamily parallel\+\_\+sessions\+\_\+running}, and {\ttfamily automate\+\_\+plan} showing the current state of your plan.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4630}{}\doxysubsubsection{automate\+Client.\+get\+Projects(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4630}
Gets the list of projects.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, projects)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily projects}\+: An array of \href{\#project-objects}{\texttt{ project objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4631}{}\doxysubsubsection{automate\+Client.\+get\+Project(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4631}
Gets information about a project.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The ID of the project.
\item {\ttfamily callback} ({\ttfamily function(error, project)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily project}\+: A \href{\#project-objects}{\texttt{ project object}} including an array of \href{\#build-objects}{\texttt{ extended build objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4632}{}\doxysubsubsection{automate\+Client.\+get\+Builds(\mbox{[}options,\mbox{]} callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4632}
Gets the list of builds.


\begin{DoxyItemize}
\item {\ttfamily options} (optional)\+: An object containing search parameters.
\begin{DoxyItemize}
\item {\ttfamily limit}\+: The number of builds to return. Defaults to {\ttfamily 10}.
\item {\ttfamily status}\+: Filter builds based on status. May be one of {\ttfamily \char`\"{}running\char`\"{}}, {\ttfamily \char`\"{}done\char`\"{}}, {\ttfamily \char`\"{}failed\char`\"{}}, {\ttfamily \char`\"{}timeout\char`\"{}}.
\end{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, builds)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily builds}\+: An array of \href{\#build-objects}{\texttt{ build objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4633}{}\doxysubsubsection{automate\+Client.\+get\+Sessions(build\+Id, \mbox{[}options,\mbox{]} callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4633}
Gets the list of sessions in a build.


\begin{DoxyItemize}
\item {\ttfamily build\+Id}\+: The hashed ID of the build.
\item {\ttfamily options} (optional)\+: An object containing search parameters.
\begin{DoxyItemize}
\item {\ttfamily limit}\+: The number of sessions to return. Defaults to {\ttfamily 10}.
\item {\ttfamily status}\+: Filter sessions based on status. May be one of {\ttfamily \char`\"{}running\char`\"{}}, {\ttfamily \char`\"{}done\char`\"{}}, {\ttfamily \char`\"{}failed\char`\"{}}.
\end{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, sessions)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily sessions}\+: An array of \href{\#session-objects}{\texttt{ session objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4634}{}\doxysubsubsection{automate\+Client.\+get\+Session(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4634}
Gets the details for a session.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The hashed ID of the session.
\item {\ttfamily callback} ({\ttfamily function(error, session)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily session}\+: A \href{\#session-objects}{\texttt{ session object}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4635}{}\doxysubsubsection{automate\+Client.\+update\+Session(id, options, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4635}
Updates the status of a session.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The hashed ID of the session.
\item {\ttfamily options}\+: An object containing the parameters.
\begin{DoxyItemize}
\item {\ttfamily status}\+: New status value. \href{https://www.browserstack.com/automate/rest-api\#rest-api-sessions}{\texttt{ May be one of}} {\ttfamily \char`\"{}completed\char`\"{}} or {\ttfamily \char`\"{}error\char`\"{}}.
\end{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, session)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily session}\+: The updated \href{\#session-objects}{\texttt{ session object}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4636}{}\doxysubsubsection{automate\+Client.\+delete\+Session(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4636}
Deletes a session.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The hashed ID of the session.
\item {\ttfamily callback} ({\ttfamily function(error, data)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily data}\+: An object with a {\ttfamily message}, confirming the deletion.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4637}{}\doxysubsection{Screenshots API}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4637}
\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4638}{}\doxysubsubsection{Browser\+Stack.\+create\+Screenshot\+Client(settings)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4638}
Creates a new client instance.


\begin{DoxyItemize}
\item {\ttfamily settings}\+: A hash of settings that apply to all requests for the new client.
\begin{DoxyItemize}
\item {\ttfamily username}\+: The username for the Browser\+Stack account.
\item {\ttfamily password}\+: The password for the Browser\+Stack account.
\item {\ttfamily proxy} (optional; default\+: {\ttfamily null})\+: Proxy server supporting HTTPS to be used for connecting to Browser\+Stack. e.\+g. {\ttfamily \char`\"{}http\+://proxy.\+example.\+com\+:1234\char`\"{}}
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4639}{}\doxysubsubsection{screenshot\+Client.\+get\+Browsers(callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4639}
Gets the list of available browsers.


\begin{DoxyItemize}
\item {\ttfamily callback} ({\ttfamily function(error, browsers)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily browsers}\+: An array of \href{\#browser-objects}{\texttt{ browser objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4640}{}\doxysubsubsection{screenshot\+Client.\+generate\+Screenshots(options, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4640}
Creates a job to take screenshots.


\begin{DoxyItemize}
\item {\ttfamily options}\+: A hash of settings for the screenshots. See \href{\#screenshot-job-objects}{\texttt{ screenshot job objects}} for details.
\begin{DoxyItemize}
\item {\ttfamily url}\+: The URL of the desired page.
\item {\ttfamily browsers}\+: A collection of \href{\#browser-objects}{\texttt{ browser objects}} indicating which browsers and devices to take screenshots with.
\item {\ttfamily win\+\_\+res} (optional)\+: Only required if taking a screenshot on Windows. Defaults to {\ttfamily \char`\"{}1024x768\char`\"{}}.
\item {\ttfamily mac\+\_\+res} (optional)\+: Only required if taking a screenshot on Mac OS X. Defaults to \char`\"{}1024x768\char`\"{}{\ttfamily . $\ast$}orientation$<$tt$>$(optional)\+: Defaults to\char`\"{}portrait\char`\"{}{\ttfamily . $\ast$}quality$<$tt$>$(optional)\+: Defaults to\char`\"{}compressed\char`\"{}{\ttfamily . $\ast$}wait\+\_\+time$<$tt$>$(optional)\+: Defaults to5{\ttfamily . $\ast$}local$<$tt$>$(optional)\+: Defaults tofalse{\ttfamily . $\ast$}callback{\ttfamily (}function(error, job){\ttfamily )\+: A callback to invoke when the API call is complete. $\ast$}job\`{}\+: A \href{\#screenshot-job-objects}{\texttt{ screenshot job object}} containing \href{\#screenshot-state-objects}{\texttt{ screenshot state objects}} in place of \href{\#browser-objects}{\texttt{ browser objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4641}{}\doxysubsubsection{screenshot\+Client.\+get\+Job(id, callback)}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4641}
Gets details about the current status of a screenshot job.


\begin{DoxyItemize}
\item {\ttfamily id}\+: The id of the job.
\item {\ttfamily callback} ({\ttfamily function(error, job)})\+: A callback to invoke when the API call is complete.
\begin{DoxyItemize}
\item {\ttfamily job}\+: A \href{\#screenshot-job-objects}{\texttt{ screenshot job object}} containing \href{\#screenshot-state-objects}{\texttt{ screenshot state objects}} in place of \href{\#browser-objects}{\texttt{ browser objects}}.
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4642}{}\doxysection{Tests}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4642}
To run the full test suite, you must have a Browser\+Stack account. Run {\ttfamily npm test} with the {\ttfamily BROWSERSTACK\+\_\+\+USERNAME} and {\ttfamily BROWSERSTACK\+\_\+\+KEY} environment variables set.

To run just the lint checks, run {\ttfamily npm lint}.\hypertarget{md_sfcode_node_modules_browserstack_readme_autotoc_md4643}{}\doxysection{License}\label{md_sfcode_node_modules_browserstack_readme_autotoc_md4643}
Copyright node-\/browserstack contributors. Released under the terms of the MIT license. 