1.0.3 • Published 1 year ago

fivesim_ts v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago