-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(examples): add example for
getPersonalInformation()
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { authenticatePronoteCredentials, PronoteApiAccountId } from "../src"; | ||
|
||
(async () => { | ||
const pronote = await authenticatePronoteCredentials("https://demo.index-education.net/pronote", { | ||
accountTypeID: PronoteApiAccountId.Eleve, | ||
username: "demonstration", | ||
password: "pronotevs", | ||
|
||
// Because this is just an example, don't forget to change this. | ||
deviceUUID: "my-device-uuid" | ||
}); | ||
|
||
const information = await pronote.getPersonalInformation(); | ||
|
||
console.log("Logged into", pronote.studentName, "studying at", pronote.schoolName, "in", pronote.studentClass); | ||
|
||
console.log("Lives at", information.address[0]); | ||
console.log("More precisely at", information.city, information.province || "(no province)", "in", information.country || "(no country)"); | ||
console.log("Can be called at", information.phone, "and emailed at", information.email); | ||
|
||
console.log(); // Break line. | ||
|
||
if (pronote.studentProfilePictureURL) { | ||
console.log("-> Profile Picture URL:", pronote.studentProfilePictureURL); | ||
} | ||
|
||
console.log("-> INE:", information.INE); | ||
})(); |