Skip to content

Simple wrapper around 5Sim with TypeScript support

Notifications You must be signed in to change notification settings

ubuygold/FiveSim_TS

 
 

Repository files navigation

5SIM

This is an unofficial wrapper around the 5SIM API calls with TypeScript support. Forked from nickpick42/FiveSim.

Installation

https://www.npmjs.com/package/fivesim_ts Use the package manager npm to install 5sim.

npm install fivesim_ts

##Recommended Usage

const FiveSim = require("fivesim_ts");

let main = async ()=> {

    let apiKey = "API_KEY_HERE"
    let SimTesting = FiveSim(apiKey)
    let numberRequest = await SimTesting.getAuthorizationNumber('any','any','google')
    let phoneNumber = numberRequest.phone //Generated phone number
    //await page.type("input[name='phone_number']",phoneNumber)
    let code = await SimTesting.waitForCode().then( verificationCode => verificationCode)
    if ( code === undefinded){
        // await SimTesting.banNumber() OR  await SimTesting.finishOrder() (NO code recieved)
    }else{
         //await page.type("input[name='verification_code']",code)
    }
   
}
main()

##Manual Usage

const FiveSim = require("../main");

let main = async ()=> {
    let apiKey = "PUT_API_KEY_HERE"
    let SimTesting = FiveSim(apiKey)
    let numberRequest = await SimTesting.getAuthorizationNumber('any','any','google')
    let phoneNumber = numberRequest.phone //Generated phone number
    let id = numberRequest.id //Id to check order
    let check = await SimTesting.checkOrder()
    let code = check.sms[0].code//Recieved Code
    let finish = await SimTesting.finishOrder()// Finish order if successful
    console.log(finish)

}
main()

Contributing

Huge thank you to the creators of 5sim. The API endpoints are extremely easy to use and thought I would do my part and upload a basic wrapper around the endpoints. Please contact me for any requested changes or updates. Forked from nickpick42/FiveSim. Added TS Support for testing(by me). Make an issue if not work.

License

MIT

About

Simple wrapper around 5Sim with TypeScript support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 77.4%
  • JavaScript 22.6%