Skip to content

Commit

Permalink
docs(examples): add example for getPersonalInformation()
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexcited committed Jan 18, 2024
1 parent 58fbf0c commit 6e514cf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/student-information.ts
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);
})();

0 comments on commit 6e514cf

Please sign in to comment.